Getting Greasemonkey to work in a Multi-Account Container

117 views
Skip to first unread message

davidh...@gmail.com

unread,
Sep 16, 2020, 7:22:03 AM9/16/20
to greasemonkey-users

I use Greasemonkey to intercept downloads from a website that I log in to - e.g. instead of downloading the text file report via the browser, Greasemonkey grabs the URL, downloads it itself with AJAX, and then does another AJAX to send it to my database.

The problem I'm having is that I use the Multi-Account Containers add-on to separate my browsing, and when I do that, any Greasemonkey activity seems to take place in a non-contained context and so I'm no longer logged in.

is there any way to keep Greasemonkey within the "context" of the tab it's running under?

LWChris

unread,
Sep 16, 2020, 6:32:17 PM9/16/20
to greasemon...@googlegroups.com

Hi,

GreaseMonkey is running in its own container, mainly to prevent access the other way round (forging a carefully crafted script to intercept GreaseMonkey scripts running on the page, and injecting malicious code "backwards" into the browser engine to access the browser internal layer of JS execution).

So I advise you to be very careful here, but I think generally you're looking for the information on this page: https://wiki.greasespot.net/Category:Coding_Tips:Interacting_With_The_Page

Any of the 4 pages, or, if everything fails, probably unsafeWindow can help (generally not recommended but sometimes the only option).

But again: be very careful! For example, I'd rather see if I can provide a REST API and use OAuth tokens from the script to access the database etc.

Chris

--
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 greasemonkey-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/greasemonkey-users/a587a572-e322-4246-8d3e-e97195ea649en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages