Does the User Scripts directory still work with Chrome 13.0?

匿名 (未验证) 提交于 2019-12-03 00:56:02

问题:

I am using Mac OS X with Google Chrome 13.0.782.107. I'm trying to set up User Scripts as per these instructions.

I have created a directory: ~/Library/Application Support/Google/Chrome/Default/User Scripts/

I created a file in that directory: hello.user.js

(function() { // ==UserScript==                                                                // @name          Hello, World                                                   // @namespace     http://localhost.localdomain                                   // @version       0.0.0                                                          //                                                                               // @include   http://*/*                                                         // ==/UserScript==                                                                  alert('Hello, World!');  })(); 

I created the following AppleScript to start Chrome

do shell script "/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome --enable-user-scripts" 

However, the script is ignored. If I drag and drop the file into Chrome and install it as an extension, it works fine. Is this feature no longer supported?

回答1:

From Brock Adams' comment, this question is a duplicate of Manually adding a Userscript to Google Chrome and is well answered there.

The flag --enable-user-scripts does not seem to be supported in recent versions of Chrome. This seems to be confirmed by this List of Chromium Command Line Switches.

Confusingly there is a (vestigial?) switch --user-scripts-dir.



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!