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

Script at about:blank stopped working #2108

Closed
klenium opened this issue Mar 15, 2015 · 7 comments
Closed

Script at about:blank stopped working #2108

klenium opened this issue Mar 15, 2015 · 7 comments
Milestone

Comments

@klenium
Copy link

klenium commented Mar 15, 2015

I have my own script that replaces the newtab's content.

// ==UserScript==
// @name newtab
// @include about:blank
// ==/UserScript==
document.body.innerHTML = 'large html';

It worked fine yesterday and before. I didn't change any settings/code. I'm using GM 3.0, but it released 2 days ago, so I don't know why it worked yesterday but doesn't work today.

@erosman
Copy link

erosman commented Mar 15, 2015

There is an error in console that states:

about:blank : Unable to run script because scripts are blocked internally.

I am not sure it is due to GM or changes in FF (running 36.0.1)

@arantius arantius added this to the 3.1 milestone Mar 16, 2015
@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.

@klenium
Copy link
Author

klenium commented Mar 16, 2015

Yes, it works fine. Thanks.

@cipriancraciun
Copy link

Looking in the code, the solution I guess was the line below:

if (/^about:blank/.test(url)) return true;

However this will match any page starting with about:blank, including about:blank-some-other-suffix. Although these are less likely, perhaps the regular expression should be anchored also at the end with an $, like:

if (/^about:blank$/.test(url)) return true;

@arantius
Copy link
Collaborator

arantius commented Jun 6, 2015

This is not an accident. about:blank#whatever is intentionally supported.

@cipriancraciun
Copy link

Then the correct regular expression would be /^about:blank(#.*)?$/.

@janekptacijarabaci
Copy link
Contributor

See also #1820

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

5 participants