Scripts and autorun


A.S.

Recommended Posts

I asked Chrome users: "How to disable HTML5 on YouTube?". They gave me this extension. It's very easy. I tried to port it to Maxthon. And I did it.

When I installed it and checked on YouTube video, it it worked. But when I opened YouTube in a few minutes, it did not work. After several attempts I understood: it does not start with browser. I must press icon of extension everytime when I restart broswer.

Question:

What should I write in def.json to automatic run script?

And can I disable the script without browser restart? Something like "stopOnClose": true...

Link to comment
Share on other sites

I just noticed this extension yesterday. I tried doing the same a while ago using that same chrome extension. I forgot about it or gave up for some reason.

Tried running yours and it wouldn't work for me? All videos still played in HTML5, but will have another play later.

As far as the question, i'm thinking it's to do with the entrypoint command. Yours lists only 'toolbar', which I think means it only runs when the icon is pressed. I think you need to use either:

'doc_start', which executes the scripts when the page begins to load;

or

'doc_end', which executes the scripts when the page finishes loading (but before frames and images are loaded).

To stop it running on every page, the you can restrict the sites by using the 'include:' option, so have it only run on youtube.com for example. I don't think there is a 'stop on close' option that I can see.

All the info should be in the SDK documents found here.

Link to comment
Share on other sites

7twenty replied at 2014-7-11 01:33 back.gif

I just noticed this extension yesterday. I tried doing the same a while ago using that same chrome e ...

OK. I wrote:

"entryPoints":

Is the script activated when I open Youtube and stoped when I close YouTube? Or Or it runs constantly?

And can I delete "toolbar" and keep only: "entryPoints": ?

This is my first such expansion. Before that I made only quick access to sidebar.

Link to comment
Share on other sites

Is the script activated when I open Youtube and stoped when I close YouTube? Or Or it runs constantly?If you use the 'include' option, it should only run on the websites allowed, just youtube for example. The way that I read the documentation, the script will stop when the page is closed.

And can I delete "toolbar"Yes, there's no requirement that I can see that there needs to be an icon on the toolbar/sidebar. Test it with both just to make sure. Can help to have it if only so you can see it's installed without running extension centre. But unless it's required to start the script there isn't any need to have it show.

Link to comment
Share on other sites

  • 2 months later...

7twenty replied at 2014-7-11 21:56 back.gif

If you use the 'include' option, it should only run on the websites allowed, just youtube for exampl ...

honestly, doc_onload is more reliable than either doc_start or doc_end.

include only runs on those sites, yes.

if it loads when the page loads, then it applies to anything the page runs from its script. think of server-end interactive scripts that work with other server-end scripts, they both load at page loading time, but work simultaneously as long as the page is kept up, only difference is, this is client-end.

cooltext.png

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.