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

GM 3.0 and 3.0 beta1 ignoring @noframes #2110

Closed
Yonezpt opened this issue Mar 16, 2015 · 3 comments
Closed

GM 3.0 and 3.0 beta1 ignoring @noframes #2110

Yonezpt opened this issue Mar 16, 2015 · 3 comments
Milestone

Comments

@Yonezpt
Copy link

Yonezpt commented Mar 16, 2015

After ~4 hours of trying to understand why my script started throwing errors in the past couple of days I finally discovered that the problem lied with the new Greasemonkey version and beta as well; The addon is ignoring the @noframes rule.

I don't know yet if this was by design or if it was overlooked and I don't see it mentioned in the changelog, but all scripts will now run in iframes despite having @noframes declared.

Sample script:

// ==UserScript==
// @name        Test
// @namespace   Test
// @version     1
// @run-at      document-start
// @match       https://www.youtube.com/*
// @grant       none
// @noframes
// ==/UserScript==
if (self === top) {
    console.info('I am not an iframe');
} else if (self !== top) {
    console.info('I am an iframe');
}

Open https://www.youtube.com/watch?v=8pRJn77UeOM, for example, and observe the console.

ss

The 3 iframe related strings show that the script is running inside iframes.

@janekptacijarabaci
Copy link
Contributor

Confirmed.

script.noframes - undefined

https://github.com/greasemonkey/greasemonkey/blob/master/modules/ipcscript.js#L16

From:

  this.namespace = aScript.namespace;

To:

  this.namespace = aScript.namespace;
  this.noframes = aScript.noframes;

And maybe add:

https://github.com/greasemonkey/greasemonkey/blob/master/modules/ipcscript.js#L73

From:

      'namespace': this.namespace,

To:

      'namespace': this.namespace,
      'noframes': this.noframes,

@arantius
Copy link
Collaborator

This fix is now included in version 3.1beta1. Please browse to Greasemonkey's AMO page and open "Development Channel" near the bottom to install the beta version. Can you confirm the fix? Thank you.

@Yonezpt
Copy link
Author

Yonezpt commented Mar 16, 2015

I can confirm, the issue is fixed on the version you mentioned. Thanks for the quick response.

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

3 participants