Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1646 commits
Select commit Hold shift + click to select a range
170564e
chore: update locale files from Transifex (#2140)
github-actions[bot] Jul 15, 2024
2d94a1a
fix #2142: actually use tabId in popup's onDisconnect
tophf Jul 16, 2024
5ce1a06
fix: restore ellipsis for script names in popup
tophf Jul 16, 2024
e3ddc89
fix #2145: always re-fetch localhost deps when saving
tophf Jul 20, 2024
2ebe7e1
refactor: don't re-fetch/validate `@icon`
tophf Jul 20, 2024
258add5
chore: update locale files from Transifex (#2147)
github-actions[bot] Jul 22, 2024
0d3e8ce
feat: network access blacklist
tophf Jul 24, 2024
fc1e8ee
fix: bg-error event
tophf Jul 24, 2024
bdb05b5
fix: expand right-click-to-edit + undo 5ce1a060
tophf Jul 25, 2024
a5b8040
v2.20.1
tophf Jul 25, 2024
f376819
feat: use FileSystemObserver for tracking local files
tophf Jul 27, 2024
e5a9f06
fix #2150: expose existing userAgentData in GM_info
tophf Jul 27, 2024
19017c3
fix: skip getHighEntropyValues if undefined
tophf Jul 27, 2024
4f7088c
fix: fso may be false
tophf Jul 27, 2024
02443a3
feat: +GM_info.userAgent, make GM_info on demand
tophf Jul 28, 2024
50293c1
fix: make Promise safe in injected-web
tophf Jul 28, 2024
2beafe8
refactor: rename to bridge.promise for clarity
tophf Jul 28, 2024
a9594b6
chore: update locale files from Transifex (#2151)
github-actions[bot] Jul 29, 2024
105811f
fix #2156: keep duplicate FormData keys in Firefox
tophf Jul 31, 2024
ac2d196
fix 2beafe8f: missed one string
tophf Aug 2, 2024
7cee81a
v2.20.2
tophf Aug 2, 2024
1415c03
chore: update locale files from Transifex (#2160)
github-actions[bot] Aug 5, 2024
0cf8740
fix: use the non-deprecated fullVersionList
tophf Aug 7, 2024
7d33709
fix: call UAD only if got userAgentData
tophf Aug 9, 2024
905ced5
chore: update locale files from Transifex (#2164)
github-actions[bot] Aug 12, 2024
974b7a6
fix #2077: show progress for dependencies
tophf Aug 16, 2024
3931715
fix: don't throttle requests from CDN
tophf Aug 16, 2024
4162b01
fix: first-time request for icon
tophf Aug 16, 2024
e937dfc
v2.20.3
tophf Aug 16, 2024
7ab4718
fix: run deps in the same lexical scope
tophf Aug 20, 2024
0195dff
fix: omit a redundant inter-deps separator
tophf Aug 20, 2024
02ddab5
v2.20.4
tophf Aug 20, 2024
f4cfe8e
fix #2170: show tardy error as a separate note
tophf Aug 21, 2024
51c9ee3
feat: enable CSS hyphenation
tophf Aug 21, 2024
e14b52a
fix 0195dff0: restore ";" before code, skip // comments
tophf Aug 22, 2024
33c0b92
fix 0195dff0: prevent catastrophic backtracking
tophf Aug 22, 2024
b40867f
chore: update Vue
tophf Aug 22, 2024
0e6d70c
refactor: sfc-setup for ScriptItem
tophf Aug 22, 2024
71b744e
refactor: use new Vue attribute shorthands
tophf Aug 22, 2024
692ffb9
fix: accessibility for toggle-button
tophf Aug 22, 2024
81e75d3
style: auto-size inputs in Find/Replace bar
tophf Aug 24, 2024
ceed3c5
refactor: sfc-setup for code.vue
tophf Aug 24, 2024
174c7b4
refactor: props are already exposed to template
tophf Aug 24, 2024
b3e03d2
fix #2175: auto-open `+` menu if got no scripts
tophf Aug 27, 2024
4458bb0
v2.20.5
tophf Sep 1, 2024
17d036c
fix: current window may be null at browser startup
tophf Sep 2, 2024
fe692c2
fix: apply script's `enabled` to open editors
tophf Sep 3, 2024
9b70848
fix: rendering of placeholders
tophf Sep 5, 2024
b6ddf2a
fix: improve+simplify popup max-height logic
tophf Sep 6, 2024
2a31486
v2.21.0
tophf Sep 8, 2024
66922d6
chore: update locale files from Transifex (#2179)
github-actions[bot] Sep 9, 2024
90c37e9
fix: race condition when preparing injection (#2181)
gera2ld Sep 11, 2024
51d3c81
v2.22.0
tophf Sep 11, 2024
fea0993
fix: greasyfork needs network delays
tophf Sep 12, 2024
6db81de
fix #2185: check any `window` for vivaldi
tophf Sep 13, 2024
20cd8ef
fix: active tab may be null in some chromiums
tophf Sep 13, 2024
202007c
fix: $menuNew is absent in new script editor
tophf Sep 13, 2024
1f16d11
fix: simplify update of deps
tophf Sep 13, 2024
6cbcf31
chore: update caniuse-lite
tophf Sep 13, 2024
128bccd
v2.23.0
tophf Sep 13, 2024
d5787a6
chore: update locale files from Transifex (#2186)
github-actions[bot] Sep 16, 2024
27ff9af
fix #2191: sfcsetup has a built-in `$`
tophf Sep 20, 2024
da48466
fix #2190: await GM.download/GMxhr in Firefox
tophf Sep 20, 2024
9223ae0
fix: measure popup after it's ready
tophf Sep 20, 2024
823a98e
v2.24.0
tophf Sep 20, 2024
5826e7e
fix #2193: userAgentData is broken in some browsers
tophf Sep 21, 2024
708c187
fix b6ddf2a2: scroll popup in mobile
tophf Sep 21, 2024
13a834b
v2.24.1
tophf Sep 21, 2024
e3aba87
chore: update locale files from Transifex (#2196)
github-actions[bot] Sep 23, 2024
a8e3b41
feat: popup width option + inline popup options
tophf Sep 23, 2024
1789e78
v2.25.0
tophf Sep 23, 2024
8ba32da
fix: resizing while dragging/typing popup width
tophf Sep 24, 2024
177fc05
fix: extraneous spaces in locale-group
tophf Sep 23, 2024
4e69c9f
fix: reuse English trailing ":", ": " except CJK
tophf Sep 24, 2024
25a4a80
fix: simplify and homogenize popup options
tophf Sep 24, 2024
00fcc82
fix #2198: IS_FIREFOX in page realm on http:// sites
tophf Sep 25, 2024
f2df8ee
fix: popup may run before browser resized it
tophf Sep 25, 2024
b7f069d
fix: add a missing ":" to labelIconURL
tophf Sep 27, 2024
80e40bf
style: reduce script command height
tophf Sep 27, 2024
da4cd71
chore: update deps to remove punycode warnings in ci
tophf Sep 27, 2024
cee4a5a
v2.25.1
tophf Sep 27, 2024
538424a
chore: update locale files from Transifex (#2202)
github-actions[bot] Sep 30, 2024
3b77cdb
fix: avoid popup scrollbar due to off-by-1 error
tophf Oct 1, 2024
0b475b4
v2.26.0
tophf Oct 1, 2024
63c4a4a
fix: actually focus new value's key input
tophf Oct 1, 2024
efacf4c
chore: update locale files from Transifex (#2204)
github-actions[bot] Oct 7, 2024
caf6360
fix: add rotate class to SVG element
gera2ld Oct 8, 2024
7c3c3ee
fix #2203: open installer in fenix incognito
tophf Oct 9, 2024
d161cd9
fix #2206: patch SafePromise::then in Firefox
tophf Oct 13, 2024
80ff902
refactor: more reliable SafePromise::then patch
tophf Oct 13, 2024
2bf6a12
refactor: add a warning when bypassing installer
tophf Oct 13, 2024
91852ff
fix 7c3c3eed: don't open the tab twice
tophf Oct 13, 2024
ff4a0b8
chore: update locale files from Transifex (#2207)
github-actions[bot] Oct 14, 2024
8cee882
v2.26.1
tophf Oct 14, 2024
42fadf7
refactor: reuse URL constants
tophf Oct 14, 2024
2dd34c3
feat: allow malformed userscript metadata + warn
tophf Oct 14, 2024
6d31a7f
fix: FileSystemObserver latest API change
tophf Oct 14, 2024
8081d77
fix: apply network blacklist to more scenarios
tophf Oct 14, 2024
d7d0f0c
chore: switch to BannerPlugin + update webpack deps
tophf Oct 14, 2024
66f3137
chore: new webpack can omit redundant runtime
tophf Oct 14, 2024
e7b4012
fix: use `.*?` to match METABLOCK_RE
tophf Oct 15, 2024
5826829
fix: blacklist `file:` URLs in new installations
tophf Oct 15, 2024
e584f48
fix: center checkbox labels vertically
tophf Oct 15, 2024
081de83
feat: add "Import / Sync" in "+" menu when empty
tophf Oct 15, 2024
5a2e908
fix: `code` can be null
tophf Oct 15, 2024
80a098e
fix #2209: Promise for GM API in Chrome pre-115
tophf Oct 15, 2024
0b46598
fix: make async GM an instance of Promise in FF
tophf Oct 15, 2024
21041e6
v2.26.2
tophf Oct 15, 2024
6b6fd85
chore: update locale files from Transifex (#2211)
github-actions[bot] Oct 21, 2024
05292f5
fix: detect more CDNs for faster updates
tophf Oct 16, 2024
76e4000
feat: expose GM_info.platform.fullVersionList and mobile
tophf Oct 24, 2024
4b8d083
v2.27.0
tophf Oct 24, 2024
3c28c45
chore: update release-edge action
gera2ld Oct 25, 2024
188f732
fix #2214: data uri is always valid
tophf Oct 25, 2024
dd60bcc
chore: update vm-types
tophf Oct 25, 2024
e7b86fd
feat: use getKeys() for much faster db startup
tophf Oct 26, 2024
3443e09
fix: omit unused exports from `injected`
tophf Oct 26, 2024
6de7986
chore: update locale files from Transifex (#2217)
github-actions[bot] Oct 28, 2024
da79ffc
fix #2218: don't blacklist the installed scripts
tophf Oct 28, 2024
17bd8f8
fix #2108: handle invalid/empty script template
tophf Oct 28, 2024
f86098b
fix e7b86fd6: always clean up dbKeys
tophf Oct 28, 2024
f0c6629
fix: wrap checkbox label + remove bad margin
tophf Oct 29, 2024
8c28fa4
fix: open a new tab if script source tab is closed
tophf Nov 1, 2024
919cacf
v2.28.0
tophf Nov 1, 2024
cfeca30
fix: retry if "Tabs cannot be edited"
tophf Nov 3, 2024
879c27c
fix #2222: remove #2214 bug leftovers from db
tophf Nov 3, 2024
971d1a0
chore: update locale files from Transifex (#2223)
github-actions[bot] Nov 4, 2024
6218f10
fix #2225: fit dropdown option width
tophf Nov 5, 2024
ea79e2b
fix: immediately open installer for a known distro
tophf Nov 7, 2024
e60a75c
fix ea79e2b0: greasyfork detection
tophf Nov 11, 2024
3afafc0
fix: handle edge cases in TabOpen
tophf Nov 11, 2024
33918fb
fix: support extended language tags (#2224)
gera2ld Nov 12, 2024
5ec6781
fix #2228: reuse SafePromise from `opener`
tophf Nov 12, 2024
dd3ffbb
v2.28.1
tophf Nov 12, 2024
7a1ef0c
feat: show network error in installer
tophf Nov 14, 2024
212a1dc
fix: show real url for relative externals
tophf Nov 15, 2024
b62f0a2
fix #2231: force-update deps on script update
tophf Nov 15, 2024
6eafc3d
chore: update locale files from Transifex (#2233)
github-actions[bot] Nov 18, 2024
dbbd600
chore: update locale files from Transifex (#2238)
github-actions[bot] Nov 25, 2024
984e62a
chore: fix jsdoc comment
tophf Nov 17, 2024
741311c
fix #2239: add a global toggle hotkey
tophf Nov 25, 2024
ab1eae9
v2.28.2
tophf Nov 25, 2024
2a2be4e
fix: HiDPI icons
p-mng Nov 28, 2024
82895bf
fix: HiDPI icons for Firefox ext panel
tophf Nov 28, 2024
afe97f6
fix: add 64px icon to `gulpfile.js` and `manifest.yml` (#2242)
p-mng Nov 28, 2024
ef6a577
fix #2243: store auto-inferred homepageURL in `from`
tophf Nov 29, 2024
d96f3f2
fix #2246: intercept github latest release
tophf Dec 1, 2024
2fb1905
chore: update locale files from Transifex (#2247)
github-actions[bot] Dec 2, 2024
a82602d
v2.29.0
tophf Dec 2, 2024
5b96c74
chore: update locale files from Transifex (#2251)
github-actions[bot] Dec 9, 2024
55fa54a
chore: update transifex link
tophf Dec 9, 2024
6635b26
chore: update locale files from Transifex (#2255)
github-actions[bot] Dec 16, 2024
f16afa7
Update and improve zh_TW Traditional Chinese locale (#2256)
PeterDaveHello Dec 17, 2024
764f055
fix #2257: inject cache raciness when envStart is empty
tophf Dec 18, 2024
0dde41c
v2.29.1
tophf Dec 18, 2024
c585c1a
fix #2265: fix the API link
tophf Jan 5, 2025
4bbe151
chore: update locale files from Transifex (#2259)
github-actions[bot] Jan 27, 2025
3e88630
v2.30.0
tophf Jan 27, 2025
016e8ce
chore: update locale files from Transifex (#2272)
github-actions[bot] Feb 3, 2025
f7e10db
chore: bump upload-artifact@v4
tophf Feb 3, 2025
ff609df
fix: use no-cache in sync requests (#2280)
null-dev Feb 23, 2025
e293051
fix #2286: detect Firefox 138 in Android
tophf Mar 9, 2025
9cb04c7
fix #2268: keep script id while tracking
tophf Mar 15, 2025
709ca81
chore: update browserlist
tophf Mar 15, 2025
e76219f
v2.31.0
tophf Mar 15, 2025
a55fc80
chore: update locale files from Transifex (#2295)
github-actions[bot] Mar 31, 2025
1a70850
fix: only register properly configured sync services
gera2ld Apr 1, 2025
e272a12
chore: update edge publish action
gera2ld Apr 1, 2025
0ab6499
chore: update locale files from Transifex (#2299)
github-actions[bot] Apr 7, 2025
6f6175a
chore: update locale files from Transifex (#2308)
github-actions[bot] Apr 28, 2025
4f07e72
chore: update locale files from Transifex (#2314)
github-actions[bot] May 5, 2025
2a47669
chore: update locale files from Transifex (#2319)
github-actions[bot] May 19, 2025
3a954b0
fix: handle greasyfork.cc
tophf May 21, 2025
067769f
feat: support `globalVars` in hints
tophf May 21, 2025
c682247
chore: update locale files from Transifex (#2335)
github-actions[bot] Jun 30, 2025
0ee473e
chore: update locale files from Transifex (#2343)
github-actions[bot] Jul 21, 2025
9c23282
chore: update locale files from Transifex (#2360)
github-actions[bot] Sep 8, 2025
107b24a
chore: update locale files from Transifex (#2361)
github-actions[bot] Sep 15, 2025
a18a4be
fix #2364: remove special chars from XHR cookie name
tophf Oct 2, 2025
e00bd2a
fix #2330: expose GM_info.script.options
tophf Oct 2, 2025
411776a
chore: use vm-types for GM_info.script.options
tophf Oct 3, 2025
2fb5dd0
fix #2035: support `icon` in GM_registerMenuCommand
tophf Oct 3, 2025
6000510
refactor: extract script and string methods
tophf Oct 4, 2025
7d9591e
fix #2313: show existing tags in editor
tophf Oct 4, 2025
90d27c0
fix: ensure tags are updated in next editor
tophf Oct 4, 2025
89d8935
v2.31.1
tophf Oct 4, 2025
0075532
deps: caniuse-lite
tophf Oct 4, 2025
f9bf5c3
chore: update lock file
github-actions[bot] Oct 6, 2025
0c36ea2
fix: extract getReadyState only when needed
tophf Oct 15, 2025
de30476
fix #2368: retest CSP in Firefox at document-end
tophf Oct 15, 2025
4b22b03
fix: retest CSP in Firefox at document-body too
tophf Oct 15, 2025
ccdd283
refactor: revert unused changes in 4b22b03a
tophf Oct 15, 2025
8dcbec8
fix 4b22b03a: don't modify realm if injectable
tophf Oct 18, 2025
91cdcae
speedup: use Uint8Array.toBase64 & fromBase64
tophf Oct 19, 2025
b904c61
speedup: use Uint8Array.toBase64 & fromBase64 in content
tophf Oct 19, 2025
f9e2ccb
chore: update locale files from Transifex (#2371)
github-actions[bot] Oct 20, 2025
6af21b0
refactor: rename VMStorageArea & mirrored globals
tophf Nov 10, 2025
454a07b
fix #2382: send UpdateValue immediately
tophf Nov 11, 2025
dee03a0
feat: show sync error in UI
tophf Nov 10, 2025
60a4f82
v2.31.2
tophf Nov 12, 2025
7e89232
refactor: homogenize usage of toCommit
tophf Nov 12, 2025
8a138bc
fix #2384: workaround for localStorage in node 25
tophf Nov 13, 2025
a82331a
fix: show UI error for runtime message handlers
tophf Nov 18, 2025
806b02b
fix #2388, fix #2389: check old script's tags correctly
tophf Nov 18, 2025
e86d6e9
fix #2391: remember editor popup position in FF
tophf Nov 20, 2025
b173984
fix: decode DAV:displayname per #2390
tophf Nov 25, 2025
1210716
fix: deep copy options to avoid modifying the original object
gera2ld Nov 25, 2025
9297486
fix #2392: expose original setTimeout/setInterval to scripts
tophf Dec 2, 2025
dac75e4
fix #2321: add descending sort modes
tophf Dec 2, 2025
e94bef3
fix #2304: don't let missing deps mangle injectedCode
tophf Dec 2, 2025
2a7e37e
fix #2137: allow to sort by last run date
tophf Dec 2, 2025
60472c0
refactor: use storage.api directly where possible
tophf Dec 2, 2025
3061e9c
speedup: use deepCopy kludge for Vue only in UI pages
tophf Dec 2, 2025
0f14567
speedup: instantly render tab-installed after 1st time
tophf Dec 2, 2025
d45f1db
types: simplify VMScript via Partial and indexed access
tophf Dec 2, 2025
bb5f1ef
chore: update deps
tophf Dec 3, 2025
d66ca6b
chore: reformat locale files
github-actions[bot] Dec 5, 2025
bf6ec67
chore: suppress an irrelevant <tr> warning from Vue
tophf Dec 5, 2025
be9bebb
speedup: check batch duration via requestAnimationFrame
tophf Dec 5, 2025
2f383b7
v2.31.3
tophf Dec 5, 2025
4e6aba5
fix: fix onedrive support
gera2ld Dec 5, 2025
202525a
feat: add option for disabling auto-sync, and buttons to manually pus…
gera2ld Dec 5, 2025
c1c6171
fix: fix sync flow using state machine
gera2ld Dec 5, 2025
ea88bb1
fix: update locales
gera2ld Dec 5, 2025
789a3ee
fix: use icons from iconify
gera2ld Dec 6, 2025
017f460
fix #2397: make Request work in incognito
tophf Dec 6, 2025
b023645
fixup 017f4605: Request is plain data now
tophf Dec 6, 2025
c9c9e55
fix: show @resource image in installer
tophf Dec 6, 2025
0eb49fe
chore: update locale files from Transifex (#2398)
github-actions[bot] Dec 8, 2025
622f4d3
fix: allow re-authorize on auth error
gera2ld Dec 8, 2025
039f3d2
fix: remove the sync request delay and handle 429 errors
gera2ld Dec 9, 2025
8b43e6e
fix: fix pull mode for remote-only items
gera2ld Dec 9, 2025
67e5491
fix #2400: Firefox window != globalThis in content mode
tophf Dec 11, 2025
0a4e823
chore: update locale files from Transifex (#2402)
github-actions[bot] Dec 15, 2025
e3030ea
fix: load full file list for syncing
gera2ld Dec 16, 2025
d381815
v2.31.4
tophf Dec 17, 2025
e51bd78
chore: update locale files from Transifex (#2405)
github-actions[bot] Dec 22, 2025
da721f0
fix #2404: keep sandbox if grantless to avoid bugs + match TM
tophf Dec 22, 2025
cf7216a
fix da721f03: unsafeWindow must be exposed in grant mode
tophf Dec 23, 2025
4da8873
fix #2407: render all scripts after closing editor
tophf Dec 25, 2025
4112cf8
chore: update locale files from Transifex (#2409)
github-actions[bot] Dec 29, 2025
f829015
v2.31.5
tophf Dec 29, 2025
41fb13f
fix #2302: add `upload` object to GMxhr
tophf Jan 1, 2026
ed2308e
feat: show GMxhr error in tab console if no `onerror`
tophf Jan 1, 2026
c67030b
cosmetics: reuse ERROR more
tophf Jan 1, 2026
dc51edc
feat: edit value as string
tophf Jan 3, 2026
2bd3ab0
feat: autocomplete GM API in editor
tophf Jan 4, 2026
b78375e
v2.31.6
tophf Jan 8, 2026
b1d4647
fix: `ids` may be absent or a string
tophf Jan 8, 2026
140b8c6
chore: update locale files from Transifex (#2414)
github-actions[bot] Jan 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .babelrc.js

This file was deleted.

4 changes: 2 additions & 2 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Chrome >= 55
Firefox >= 53
Chrome >= 61
Firefox >= 57
4 changes: 1 addition & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@ end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
quote_type = single
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
**/*.js
!src/**
!test/**
!scripts/*
!gulpfile.js
src/public/**
192 changes: 172 additions & 20 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
const { readGlobalsFile, restrictedSyntax } = require('./scripts/webpack-util');
const ovr = makeOverrides();

module.exports = {
root: true,
extends: [
require.resolve('@gera2ld/plaid/eslint'),
require.resolve('@gera2ld/plaid-vue/eslint/vue'),
'eslint:recommended',
'plugin:vue/vue3-essential',
'prettier',
],
env: {
browser: true,
node: true,
es2021: true,
},
parserOptions: {
ecmaFeatures: {
legacyDecorators: true,
},
parser: '@babel/eslint-parser',
ecmaVersion: 'latest',
sourceType: 'module',
},
overrides: [{
// `browser` is a local variable since we remove the global `chrome` and `browser` in injected*
// to prevent exposing them to userscripts with `@inject-into content`
files: ['*'],
excludedFiles: [
'src/injected/**/*.js',
'src/common/*.js',
],
globals: {
browser: false,
},
}],
plugins: ['jest'],
rules: {
'import/extensions': ['error', 'ignorePackages', {
js: 'never',
vue: 'never',
'prettier/prettier': 'off',
'no-constant-condition': 'off',
'no-shadow': 2,
'no-unused-expressions': 2,
'no-use-before-define': ['error', {
'functions': false,
'classes': true,
'variables': false, // allowing for upper scopes
'allowNamedExports': true,
}],
// copied from airbnb-base, replaced 4 with 8
'object-curly-newline': ['error', {
Expand All @@ -33,5 +37,153 @@ module.exports = {
ImportDeclaration: { minProperties: 8, multiline: true, consistent: true },
ExportDeclaration: { minProperties: 8, multiline: true, consistent: true },
}],
'semi': ['error'],
},
overrides: [{
// `browser` is a local variable since we remove the global `chrome` and `browser` in injected*
// to prevent exposing them to userscripts with `@inject-into content`
files: ['*'],
excludedFiles: [...ovr.FILES_INJECTED, ...ovr.FILES_SHARED],
globals: {
browser: false,
...ovr.GLOBALS_COMMON,
},
}, {
files: ovr.FILES_SHARED,
globals: ovr.GLOBALS_COMMON,
}, {
files: ovr.FILES_WEB,
globals: ovr.GLOBALS_WEB,
}, {
files: ovr.FILES_CONTENT,
globals: ovr.GLOBALS_CONTENT,
}, {
files: ovr.FILES_INJECTED,
excludedFiles: [...ovr.FILES_CONTENT, ...ovr.FILES_WEB],
// intersection of globals in CONTENT and WEB
globals: Object.keys(ovr.GLOBALS_CONTENT).reduce((res, key) => (
Object.assign(res, key in ovr.GLOBALS_WEB && { [key]: false })
), {}),
}, {
files: [...ovr.FILES_INJECTED, ...ovr.FILES_SHARED],
rules: ovr.INJECTED_RULES,
}, {
files: ovr.FILES_WEB,
rules: {
...ovr.INJECTED_RULES,
'no-restricted-syntax': [
...ovr.INJECTED_RULES['no-restricted-syntax'],
{
selector: '[regex], NewExpression[callee.name="RegExp"]',
message: 'RegExp internally depends on a *ton* of stuff that may be spoofed or broken',
// https://262.ecma-international.org/12.0/#sec-regexpexec
},
],
},
}, {
// build scripts
files: [
'*.js',
'scripts/*.js',
'scripts/*.mjs',
],
env: { node: true },
rules: {
'global-require': 0,
'import/newline-after-import': 0,
'import/no-extraneous-dependencies': 0, // spits errors in github action
'import/extensions': 0,
}
}, {
files: ['*.vue'],
rules: {
'vue/multi-word-component-names': 0,
},
}, {
files: ['test/**'],
env: {
'jest/globals': true,
},
}],
};

function makeOverrides() {
/* Note that `injected` uses several more `common` files indirectly, but we check just these
* two automatically because they are trivial by design and must always pass the check */
const GLOBALS_SHARED = getGlobals('*');
const GLOBALS_INJECTED = {
...getGlobals('injected'),
PAGE_MODE_HANDSHAKE: false,
VAULT_ID: false,
};
function getGlobals(path) {
const res = {};
const { ast } = readGlobalsFile(path, { ast: true });
ast.program.body.forEach(body => {
const { declarations } = body.declaration || body;
if (!declarations) return;
declarations.forEach(function processId({
id: {
left,
properties,
name = left && left.name,
},
}) {
if (name) {
// const NAME = whatever
// We consider `let` immutable too to avoid unintentional reassignment
res[name] = false;
} else if (properties) {
// const { NAME1, prototype: { NAME2: ALIAS2 } } = whatever
properties.forEach(({ value }) => processId({ id: value }));
}
});
});
return res;
}

return {
FILES_CONTENT: [
'src/injected/index.js',
'src/injected/content/**/*.js',
],
FILES_INJECTED: [
'src/injected/**/*.js',
],
FILES_SHARED: [
'src/common/browser.js',
'src/common/consts.js',
'src/common/safe-globals-shared.js',
],
FILES_WEB: [
'src/injected/web/**/*.js',
],
GLOBALS_INJECTED,
GLOBALS_SHARED,
GLOBALS_COMMON: {
...GLOBALS_SHARED,
...getGlobals('common'),
re: false, // transform-modern-regexp with useRe option
},
GLOBALS_CONTENT: {
INIT_FUNC_NAME: false,
...GLOBALS_SHARED,
...getGlobals('injected/content'),
...GLOBALS_INJECTED,
},
GLOBALS_WEB: {
...GLOBALS_SHARED,
...getGlobals('injected/web'),
...GLOBALS_INJECTED,
IS_FIREFOX: false, // passed as a parameter to VMInitInjection in webpack.conf.js
},
INJECTED_RULES: {
'no-restricted-imports': [
'error', {
patterns: ['*/common', '*/common/*'],
}
],
'no-restricted-syntax': ['error', ...restrictedSyntax],
},
};
}
1 change: 0 additions & 1 deletion .github/FUNDING.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Bug report
about: For bugs that also exist in beta
title: "[BUG] "
labels: bug
assignees: ''

---

<!-- Please search the existing issues first as the problem may be already reported.
Please verify the bug is not fixed in the latest beta:
https://github.com/violentmonkey/violentmonkey/releases -->

### Sequence of actions: <!-- e.g. install userscript, open example.com, click page -->
1.
2.
3.

### Problem: <!-- e.g. error in devtools console -->

### Expected result: <!-- e.g. "ok" in console or some button appears -->

#### Devtools console contents:

#### Environment:
- OS: Windows
- Browser: Chrome 123 <!-- specify the real version -->
- Violentmonkey Version:
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[Feature] "
labels: enhancement
assignees: ''

---

**Motivation**
<!-- Is your feature request related to a problem? Please describe what the problem is. -->

**Proposed Solution**
<!-- A clear and concise description of what you want to happen. -->

**Use Cases**
<!-- If applicable, please describe how you would use this feature. -->
50 changes: 50 additions & 0 deletions .github/workflows/amo-download.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Download AMO signed unlisted package

on:
workflow_dispatch:
inputs:
version:
required: true
repository_dispatch:
types:
- amo_download

jobs:
amo-download:
if: ${{ github.event.client_payload.version || github.event.inputs.version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
node-version: '20'

- name: Prepare
run: yarn && node scripts/action-helper.js
env:
ACTION_BUILD_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
DISCORD_WEBHOOK_RELEASE: ${{ secrets.DISCORD_WEBHOOK_RELEASE }}
VERSION: ${{ github.event.client_payload.version || github.event.inputs.version }}

- name: Download signed file and upload to GitHub release
run: |
mkdir -p $TEMP_DIR/updates
DEBUG=amo-upload BETA=1 node scripts/amo-upload.mjs
env:
AMO_KEY: ${{ secrets.AMO_KEY }}
AMO_SECRET: ${{ secrets.AMO_SECRET }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Update updates.json
uses: JamesIves/github-pages-deploy-action@4.1.0
with:
branch: updates
folder: ${{ env.TEMP_DIR }}/updates
commit-message: Update to ${{ env.VERSION }} 🚀

- name: Upload assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
node -e 'import("./scripts/release-helper.mjs").then(({ uploadAssets }) => uploadAssets())';
Loading