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

"New user script" doesn't open a new tab #2994

Closed
seishun opened this issue Sep 3, 2018 · 5 comments

Comments

Projects
None yet
4 participants
@seishun
Copy link

commented Sep 3, 2018

Using Greasemonkey 4.7, Firefox 61.0.2. When clicking "New user script", nothing appears to happen, but "Unnamed Script XXXX" is added to the "User script for this tab" list.

The following errors show up in the browser console:

[Show/hide message details.] [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIContentPermissionRequest.principal]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: jar:file:///C:/Program%20Files%20(x86)/Mozilla%20Firefox/browser/omni.ja!/components/nsBrowserGlue.js :: prompt :: line 2850"  data: no]
prompt
jar:file:///C:/Program Files (x86)/Mozilla Firefox/browser/omni.ja!/components/nsBrowserGlue.js:2850:1
NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIContentPermissionRequest.cancel] nsBrowserGlue.js:2874
[Show/hide message details.] [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIContentPermissionRequest.principal]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: jar:file:///C:/Program%20Files%20(x86)/Mozilla%20Firefox/browser/omni.ja!/components/nsBrowserGlue.js :: prompt :: line 2850"  data: no]
prompt
jar:file:///C:/Program Files (x86)/Mozilla Firefox/browser/omni.ja!/components/nsBrowserGlue.js:2850:1
NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIContentPermissionRequest.cancel]

Same happens on a fresh profile.

@Eselce

This comment has been minimized.

Copy link
Contributor

commented Sep 4, 2018

Experienced that as well (GM v4.7), but I can't say, when it started...

@arantius

This comment has been minimized.

Copy link
Collaborator

commented Sep 4, 2018

Confirmed in 2018.08.28 nightly; Firefox is Built from https://hg.mozilla.org/releases/mozilla-release/rev/975058795980dfbba1daedfe5fc82d1abcb5638b, 61.0.2. Most relevant error seems to be:

TypeError: content is null ext-browser-content.js:234:9 

That's not our code, though, so .. it's something we're passing? The error has no traceback attached.

@arantius arantius added this to the 4.8 milestone Sep 4, 2018

@arantius

This comment has been minimized.

Copy link
Collaborator

commented Sep 4, 2018

This works in 4.6, fails at head. Git bisect tells me:

5cb38357954bc0bd797d5e70b186ede581b7196a is the first bad commit
commit 5cb38357954bc0bd797d5e70b186ede581b7196a
Author: Anthony Lieuallen <arantius@gmail.com>
Date:   Fri Jul 20 15:34:31 2018 -0400

    Track install and edit time.
    
    Don't (auto) update a script that's been edited since install time.
    
    Refs #2531

:040000 040000 5ed933a6eb8717e5ef810b7e46c1bf7ec44bc25a 9f13ac5508a51d3b0c0b2aff45e02a5e3ec1d50b M      src
:040000 040000 260f6f0e18145a4fbfdad57439d3cb40b5baabb5 109c86127e79cb4f8d5ae9ad383784c00c996c9f M      test

5cb3835 is the bad commit that introduced this. A first look through confuses me about how/why.

@Sxderp

This comment has been minimized.

Copy link
Contributor

commented Sep 7, 2018

Your problem is here: 5cb3835#diff-6ba827f37e1348164a6c4d6c5d015654R299
Curly braces were added. Therefore the anonymous function is now a 'block' rather than a line. Blocks don't return anything (unlike a line which will return whatever the expression evaluates to). 'undefined' is immediately resolved and window.close is executed.

@arantius arantius closed this in d95d58f Sep 7, 2018

@arantius

This comment has been minimized.

Copy link
Collaborator

commented Sep 7, 2018

Thanks @Sxderp ! That was it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.