On Tue, Jan 27, 2009 at 11:45 AM, cjbehm <[email protected]> wrote:
> It used to be that I could have a common.user.js and then call
> functions that were defined within "common" from other scripts (or
> from the JS console). Now, it seems like Chrome/Chromium reads the
> script, executes it, and flushes it.
>
> Bluntly, that sucks. Hopefully that's a bug and will be fixed,
> otherwise I'll just stick with the build before that changed :) When
> I'm not at work I plan to file a bug report on that, because I think
> it's broken behavior.

It was done on purpose, for compatibility with Greasemonkey, which
also does this. All that's happening is that your script is being
wrapped in an anonymous function: "(funtion() {" + your code + "})()".

If you want to share code between scripts, you can do something like:

window.foo = function() {
  ...
}

... and then call foo() from other scripts.

- a

--~--~---------~--~----~------------~-------~--~----~
Chromium Discussion mailing list: [email protected] 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-discuss
-~----------~----~----~----~------~----~------~--~---

Reply via email to