violentmonkey / violentmonkey-oex

Violentmonkey, userscripts support for Opera (Presto).
GNU General Public License v3.0
39 stars 21 forks source link

Don't ask user to install script if the .user.js URL is a web page #1

Closed LouCypher closed 11 years ago

LouCypher commented 11 years ago

Violentmonkey: v1.2-fancy Opera: v12.12

Steps to re-produce:

  1. Go to https://github.com/LouCypher/userscripts/blob/master/userscripts.org/uso-edit-code-on-page.user.js.
  2. Web page loaded.

Expected result Violentmonkey should not ask to install script.

Actual result Violentmonkey asks (prompt) user to install script.

gera2ld commented 11 years ago

How would you decide whether it's a web page or UserJS? Violentmonkey decides a UserJS by URL currently, so I think this URL should be regarded as a UserJS. You can load it as a web page by clicking with the middle button anyway. Do you have any better ideas about deciding the way to open a link?

gera2ld commented 11 years ago

Another way is to install .user.js links only in userscripts.org. I'm wondering whether it's necessary. Perhaps an option to this may be added.

gwarser commented 11 years ago

https://github.com/Dither/readable-javascript/blob/master/includes/injected.js

gera2ld commented 11 years ago

The script above deals with pages after loading them. It will be strange in userscripts.org if you click INSTALL and the link is still opened (the INSTALL button is actually a link to a .user.js file). Maybe it's better to install scripts this way only in userscripts.org.

gera2ld commented 11 years ago

Fixed. Only links in userscripts.org are listened. Other links are loaded as web pages first and then decided whether to be recognized as .user.js.

LouCypher commented 11 years ago

Thanks. Fixed on e257e60010.