4

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?

Jason
  • 9,408
  • 5
  • 36
  • 36
  • 1
    Pretty sure those instructions are way, **way** obsolete. (But I don't have a Mac handy to check). Just drag your script to any Chrome window, or install per http://stackoverflow.com/questions/5258989/manually-adding-a-userscript-to-google-chrome/5259212#5259212 (Windoze instructions, but should easily port to the Mac). – Brock Adams Aug 06 '11 at 17:54

1 Answers1

4

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.

Community
  • 1
  • 1
Jason
  • 9,408
  • 5
  • 36
  • 36
  • 5
    User script directory support was removed with http://crrev.com/87618. Thanks for pointing out the --user-scripts-dir flag, I'll remove that too. – Mihai Parparita Aug 08 '11 at 15:14