Sign in to follow this  
Followers 0
Skitty

User Javascript Context trouble, chromium/firefox greasemonkey

2 posts in this topic

I don't know where else to ask, and I've been here more than other places so I assume maybe there is someone who's experienced an issue I just stumbled into while developing a user javascript file..

I created a simple extension for a website, rather large actually.. I was testing it on Firefox during its development using greasemonkey and everything worked well, I could access variables created by scripts delivered by the site in the context of the window and listen to fired off events created by another jquery script in the window, but when I attempted to use it in chromium by dragging dropping file called "script.user.js" into extensions window, somehow chromium seems to not allow the script to interact with the variables of the other script, I cannot listen to events or use the existing jquery that is in the sites main scripts, I have to manually include my own copy of jquery,

chromium somehow does it so that the scritp has its own context to the window and does not allow it to interact with the context of the other script... This is strange. Greasemonkey under firefox does not do this though and seems it is more lenient on permissions...

This has complicated development of the script to keep it comparable on both browsers. Does anyone know what can be done to make chromium allow the script to "see"  and interact with the other scripts that are delivered server side? I'm not sure if this is a good explanation, I hope you can understand.

tl;dr somehow chromium does not let a userscript file access variables outside of the script file in a webpage while firefox does, any fix to this?


Things that I've done..

Icon Resource Editor: icon resource editor 

AutoIt Piano: a piano

AutoIt Unlocker: unlocks files when you want to delete them

Colorful tooltips: a wrapper for the tool tips UDF

Rouge GoogleBot: a full screen animation

ASciTE text editor: a text editor written in autoit

Warning: Posts by this user are subject to change or may disappear without notice.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Ok, after all this time I see what it is now.

https://developer.chrome.com/extensions/content_scripts#execution-environment

I should have never started initial development on firefox...

Edited by CaptainClucks

Things that I've done..

Icon Resource Editor: icon resource editor 

AutoIt Piano: a piano

AutoIt Unlocker: unlocks files when you want to delete them

Colorful tooltips: a wrapper for the tool tips UDF

Rouge GoogleBot: a full screen animation

ASciTE text editor: a text editor written in autoit

Warning: Posts by this user are subject to change or may disappear without notice.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0