violentmonkey icon indicating copy to clipboard operation
violentmonkey copied to clipboard

MV3 compatibility (NEEDS TESTING)

Open divinity76 opened this issue 1 week ago • 4 comments

Experimental MV3 compatibility.

Requires doing this before testing: image image

Basically just hacked at every error and tried random things until violentmonkey started working.

Only tested on Chrome. If it works on Firefox/android, it's a miracle, needs testing.

If GM.xmlHttpRequest also works perfectly, that's another miracle, GM.xmlHttpRequest should be semi-broken, at least in regards to cookie-manipulation and header manipulation, needs testing.

Liberal use of ChatGPT assisted development.

May resolve https://github.com/violentmonkey/violentmonkey/issues/1934 and https://github.com/violentmonkey/violentmonkey/issues/2284

divinity76 avatar Dec 10 '25 15:12 divinity76

Thanks, but we can't use this because too many features are broken or not implemented. A proper implementation should use chrome.declarativeNetRequest instead of WebRequestBlocking, chrome.offscreen for WebDAV and GM_xmlhttpRequest, and many many other things.

tophf avatar Dec 10 '25 15:12 tophf

Another fundamental requirement is to use chrome.userScripts.register, not executeScript. That would require rewriting a lot of code, naturally.

tophf avatar Dec 10 '25 15:12 tophf

Another fundamental requirement is to use chrome.userScripts.register, not executeScript. That would require rewriting a lot of code, naturally.

what's the problem with using chrome.userScripts.execute ?

divinity76 avatar Dec 10 '25 15:12 divinity76

It doesn't guarantee document-start execution before any other page scripts can run.

tophf avatar Dec 10 '25 16:12 tophf