用户脚本目录是否仍然适用于Chrome 13.0? [英] Does the User Scripts directory still work with Chrome 13.0?

查看:108
本文介绍了用户脚本目录是否仍然适用于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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆