What problems exactly are you running into if you just try the naive approach of running the script with @grant none and absolutely no other attempt to patch things up? That is, no code injection, no nothing.

On 2015-01-26 10:34, Shadow wrote:

I am trying to understand how the |grant none| feature works in greasemonkey from an addon point of view. I am creating a simple addon that will only insert a userscript.user.js file into a page that meets the url mask, but so far I am using a content script injection technique:

|
varsource=function(){<-Originalcode ishere->};varinsert =document.createElement('script');insert.textContent ="("+source +")()";document.head.appendChild(insert);
|

This works for my addon and with Greasemonkey as well (even if grant is none), however what I want is to not have to use a script injection technique and instead run the script on the page just like how |grant none| does, no need to use |unsafeWindow| either. Simply run as if it was a script that was loaded with the page itself.

I have tried looking for documentation that could explain how your |grant none| works, but so far I had no luck. I am stuck with the addon's pageMod + contentScriptFile technique and that's it. I also tried reading your source code, but there is a monumental amount of code which doesn't make it easier to understand the mechanism of grant none.


--
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/greasemonkey-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to