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

Add UserJavaScript support #336

Closed
uahim opened this issue Jun 5, 2014 · 16 comments
Closed

Add UserJavaScript support #336

uahim opened this issue Jun 5, 2014 · 16 comments

Comments

@uahim
Copy link

uahim commented Jun 5, 2014

I'm aware this has very low priority, but it would be excellent if it could be added in later versions as UserJS lets the user define how a site works in many cases - not vice versa ;-)

@Emdek
Copy link
Member

Emdek commented Jun 5, 2014

Not really a low priority, it's quite useful, along user CSS. ;-)
Basic support is not that hard to implement, hardest part is common issue - how to match URLs in most efficient way.

@lollox
Copy link

lollox commented Jun 6, 2014

can't we simply rely on grease/violent/tamper-monkey implementation?

@Emdek
Copy link
Member

Emdek commented Jun 6, 2014

@lollox, nope, and we don't need, it's not that hard to do (except for efficient URL matching, needed by other components anyway).

@Chocimier
Copy link
Contributor

I think that for userjs we don't have to use very efficient matching, qt's wildcards should be enough. It's just a few comparision for every web page open, much less than in adblock.

@Emdek
Copy link
Member

Emdek commented Jun 9, 2014

@Chocimier, yes, but it would be best to have only one parser and single syntax for all purposes. ;-)

@uahim
Copy link
Author

uahim commented Jun 15, 2014

for now, javascript bookmarklets already work :)

@lollox
Copy link

lollox commented Jun 24, 2014

http://www.ghacks.net/2014/06/18/greasemonkey-2-0-introduces-changes-may-break-scripts/

seems the new version could introduce incompatibility problems with some scripts... I don't know if this could affect Otter too, so just for your information :)

@Zero3K
Copy link

Zero3K commented Mar 22, 2016

What's the status on implementing this?

@Emdek
Copy link
Member

Emdek commented Mar 23, 2016

@Zero3K, basic support (loading selected / all scripts every time) isn't a big task, but providing compatibility with existing solutions is harder.
Perhaps I should split this ticket into two, keeping this for basic implementation (well, it will be enough in most cases anyway, I guess) and another one for more advanced stuff (possibly QtWebKit specific).

@uahim
Copy link
Author

uahim commented Mar 23, 2016

@Emdek so if possible, add basic support for the time being and let users enable it via basic_userjs true (with default being false) in about:config? :) Otter is better than Vivaldi already, but adding this would make it win the race for now

@Emdek
Copy link
Member

Emdek commented Mar 23, 2016

@uahim, I don't think that we really need an option for that, for now it should be enough to check if that directory exists.
Perhaps I'll find some time to create basic manager too.

@Emdek Emdek modified the milestones: Beta 10, Beta 11 Mar 28, 2016
@Emdek
Copy link
Member

Emdek commented Mar 28, 2016

Here is ticket for tracking work on improved support for GM scripts: #1091.

@pierreporte
Copy link
Contributor

pierreporte commented Sep 13, 2016

I wrote a comment #832 (comment) in response of @zoidbergthepopularone about a potential user-JS password manager. He said that he disables JS since it is a “huge security hole” and it leads me to an interrogation: could remote JS be disabled while user JS be still enabled? That way, users could still use their userscripts while avoiding JS provided by websites.

Edit: I didn’t post in #1091 since it’s not really about Greasemonkey compatibility. I may be wrong though.

@zoidbergthepopularone
Copy link

@pierreporte: 1) From what I have seen, I very much doubt that modern browser engines (at least Chromium, Blink, WebKit and Gecko) support differentiation of the source of a particular script. As an evidence I would like to point out that, to the best of my knowledge, no browser based on the mentioned engines allows a creation of extension which would be able to interact with a webpage AND not require javascript turned on for that webpage. AFAIK, the extension's code gets injected into the webpage and then treated as the webpage's native script. The same is true for e.g. Opera 12's UserJS implementation.

  1. Microsoft did very much the same thing in Internet Explorer 4 with the introduction of different security zones. A great number of critical vulnerabilities of IE comes from the fact that a webpage managed to break from the Internet zone to the My Computer zone. I would take that as indication that properly separating sources of scripts would be a difficult challenge.

@The-Compiler
Copy link

QtWebEngine allows running JS via runJavaScript with the page having disabled just fine, QtWebKit allows it with a workaround which works fine in all scenarios I could test, but apparently doesn't for some users - see this file for some related tests I've written to verify that.

I'm also pretty sure Chromium extensions run just fine when the JS is disabled for the page.

@ccd0
Copy link

ccd0 commented Sep 14, 2016

I'm also pretty sure Chromium extensions run just fine when the JS is disabled for the page.

They do for the most part, although event handlers registered by the extension don't work. Event handlers from Greasemonkey scripts in Firefox work without JS enabled, though.

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

No branches or pull requests

9 participants