Is there a way to run javascript autostart (like Bookmarks) when the page loads?

To execute the bookmarklet code, the booklet booklet must be executed by the user. Is there a way to get the bookmarklet or even any javascript to start automatically when the page loads?

Or is it a transition add-on?

thanks

+4
source share
5 answers

I don’t think you can autostart the bookmarklet on pageload. This can be used very maliciously.

I think a plugin is the best way to go here. If only for personal use, you should check greasemonkey for Firefox .

+5
source
+3
source

Greasemonkey or Tampermonkey in Chrome allows this ... but they need a script that you want to run

for example, if a certain type of overlay ad is always placed on a certain site and you can find or write a script to kill it, you can enter this source in Tampermonkey and it will be launched on every page load globally or on any site / domain / wildcard the expression you designated

alternatively, if you want to block certain scripts and want to automate the process, Notscript for chrome will show you every script that was run when you visited the site and let you determine what you want to allow on subsequent visits to this site or on all sites, very cool .. this way you don't have to write or find a script to block behavior that you don't like

as mentioned earlier, when you do this, you seriously resort to browser security, so be careful and just do not configure the old script if you cannot read them or trust the source ....

+2
source

I think Opera allows you to automatically inject js into the library of sites that you definitely download regardless of ownership.

+1
source

Well, any javascript is triggered automatically using the onload event, if you need it?

0
source

Source: https://habr.com/ru/post/1299308/


All Articles