Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scripts with @grant none and early return never run #1568

Closed
Ventero opened this issue Jun 17, 2012 · 1 comment
Closed

Scripts with @grant none and early return never run #1568

Ventero opened this issue Jun 17, 2012 · 1 comment
Milestone

Comments

@Ventero
Copy link
Contributor

Ventero commented Jun 17, 2012

When installing a script which doesn't use the GM_* API (or explicitly contains @grant none) and contains an early return, the script is never run. An example script can be found here, with GM 0.9, this script would show an alert, with GM HEAD it doesn't.

The reason is that since the script has an implicit (or explicit) @grant none, it isn't initially wrapped inside an anonymous function in service#injectScripts. But since it also doesn't specify an @unwrap metadata key, it's not run again (wrapped in an anonymous function) after throwing a "return not in function" error.

For backwards compatibility, one of the two checks should be removed.

@arantius
Copy link
Collaborator

it isn't initially wrapped inside an anonymous function in service#injectScripts.

That seems to be the real bug. I shouldn't have done that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants