I
I
Ivan Gromky2016-04-30 22:20:57
userscript
Ivan Gromky, 2016-04-30 22:20:57

How does @resource work in userscript?

Good day, I decided to upload userscripts to a couple of sites, for this I installed tampermonkey in chrome. I wanted on one of the film sites instead of a carousel of general popularity to stick my series that I always watch (with the release of each series) and SUCH A QUESTION arose!
So how can you still use @resource while wondering how to properly connect a local file to it?
I tried it as described in the article on Habré , but for some reason it doesn't work! Yes, the article is for GreaseMonkey, not Tampermonkey - but in the documentation there is a resource call with the same prefix!
And yet nothing happens - instead of connecting the resource in plain text, it is written like this: GM_getResourceText("my_resource") !
after doing $('.overview').html('GM_getResourceText("my_resource")');
this is what I end up seeing

<ul class="overview" style="width: 4320px; left: -160px;">GM_getResourceText("my_resource")</ul>

file
included //@resource my_resource file:///C:/MY/DISTRIB/web/userscript/myFav.html

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question