用户脚本目录是否仍然适用于Chrome 13.0? [英] Does the User Scripts directory still work with Chrome 13.0?
问题描述
我正在使用Mac OS X和Google Chrome 13.0.782.107。我正在尝试按照设置用户脚本这些指令。
我创建了一个目录:
〜/ Library / Application Support / Google / Chrome / Default / User Scripts / p>
我在该目录中创建了一个文件:hello.user.js
(function(){
// == UserScript ==
// @name Hello,World
// @namespace http://localhost.localdomain
// @version 0.0.0
//
// @include http:// * / *
// == / UserScript ==
alert('Hello,World!');
})();
我创建了以下AppleScript以启动Chrome
执行shell脚本/ Applications / Google \\ Chrome.app/Contents/MacOS/Google\\ Chrome --enable-user-scripts
但是,脚本被忽略。如果我将文件拖放到Chrome中并将其作为扩展安装,则可以正常工作。此功能不再支持吗?
来自Brock Adams的评论,这个问题是手动向Google Chrome添加一个UsersScript ,并且在那里得到了很好的回答。
在最近的Chrome版本中,标志--enable-user-scripts似乎不受支持。这似乎已通过此 Chromium命令行开关列表进行了确认。
令人困惑的是有一个(退化?)开关--user-scripts-dir。
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?
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.
这篇关于用户脚本目录是否仍然适用于Chrome 13.0?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!