2011-08-06 33 views
3

我正在使用Mac OS X和Google Chrome 13.0.782.107。我試圖按照these instructions設置用戶腳本。用戶腳本目錄是否仍然適用於Chrome 13.0?

我創建了一個目錄: 〜/庫/ Application Support /谷歌/鉻/默認/用戶腳本/

我創建了該目錄中的文件:hello.user.js

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

    alert('Hello, World!'); 

})(); 

我創建了下面的AppleScript啓動Chrome的

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

但是,該腳本將被忽略。如果我將文件拖放到Chrome中並將其作爲擴展安裝,則可以正常工作。此功能是否不再支持?

+1

很確定這些說明是方式,**方式**過時。 (但我沒有一個Mac可以檢查)。只需將您的腳本拖動到任何Chrome窗口,或按照http://stackoverflow.com/questions/5258989/manually-adding-a-userscript-to-google-chrome/5259212#5259212安裝(Windoze說明,但應該輕鬆移植到Mac)。 –

回答

4

來自Brock Adams的評論,這個問題是Manually adding a Userscript to Google Chrome的重複,在那裏得到了很好的回答。

標誌--enable-user-scripts在最近版本的Chrome中似乎不受支持。這似乎證實了這個List of Chromium Command Line Switches

令人困惑的是有一個(退化的?)開關--user-scripts-dir。

+4

用戶腳本目錄支持已通過http://crrev.com/87618刪除。感謝您指出--user-scripts-dir標誌,我也會將其刪除。 –

相關問題