3.7.0
Greasemonkey for UXP 3.7.0
Closes out the 3.7.0-beta1 dev cycle. Two themes: a Violentmonkey-parity audit and a performance audit.
Compatibility & correctness
GM_addElement/GM_addStyleattach the page's CSP nonce — injected<script>/<style>now run on nonce-CSP pages (GitHub, Google Search, modern news sites) where they were silently blocked.GM_xmlhttpRequest({url, onload})defaultsmethodto"GET"per spec instead of throwing.@matchaccepts:port—http://localhost:3000/*parses correctly.@connect *.domain.tldwildcard matches the bare host and any subdomain (TM-compatible).GM_info.platformexposesbrowserNameandbrowserVersion.- Storage Front throws (args-check, circular-value reject, db / dbFile getters,
close) constructErrorin the script's JS realm soe instanceof Errorworks in script catch blocks. responseXMLclone failure no longer aborts the entire XHR.GM_addElementacceptsObject.create(null)for the attributes object.- Latent bug:
fileXhrHTTP method literal"open"→"GET".
Performance
Most visible for power-user profiles (200+ scripts). No correctness impact.
MatchPatterninstances reused across URL tests instead of being flattened to strings and recompiled per call (~5–30 ms saved per navigation).- URL-test result memo + per-tab
scriptsForUrlcache. GM_getValueskipsCu.cloneIntofor primitive returns.- Per-script lowercased
@grantSetreplaces ~180.toLowerCase()calls per sandbox build. GM_setValueno-op identical writes skip the SQL write + listener fire entirely.- XPCOM service /
nsIStringBundlecaching acrosslogError,uuid,alert,getBrowserWindow,compareVersion. - 8 smaller micro-optimisations.