From 178782a9f748b397229b5333655efa4dfb97ac1b Mon Sep 17 00:00:00 2001 From: ACTCD <101378590+ACTCD@users.noreply.github.com> Date: Mon, 7 Jul 2025 16:44:12 +0000 Subject: [PATCH 01/37] build(gem): update fastlane --- fastlane/Gemfile.lock | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/fastlane/Gemfile.lock b/fastlane/Gemfile.lock index 989cb342..a8ba4db2 100644 --- a/fastlane/Gemfile.lock +++ b/fastlane/Gemfile.lock @@ -9,26 +9,26 @@ GEM public_suffix (>= 2.0.2, < 7.0) artifactory (3.0.17) atomos (0.1.3) - aws-eventstream (1.3.2) - aws-partitions (1.1106.0) - aws-sdk-core (3.224.0) + aws-eventstream (1.4.0) + aws-partitions (1.1125.0) + aws-sdk-core (3.226.2) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) base64 jmespath (~> 1, >= 1.6.1) logger - aws-sdk-kms (1.101.0) - aws-sdk-core (~> 3, >= 3.216.0) + aws-sdk-kms (1.106.0) + aws-sdk-core (~> 3, >= 3.225.0) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.186.1) - aws-sdk-core (~> 3, >= 3.216.0) + aws-sdk-s3 (1.192.0) + aws-sdk-core (~> 3, >= 3.225.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) - aws-sigv4 (1.11.0) + aws-sigv4 (1.12.1) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) - base64 (0.2.0) + base64 (0.3.0) claide (1.1.0) colored (1.2) colored2 (3.1.2) @@ -57,10 +57,10 @@ GEM faraday (>= 0.8.0) http-cookie (~> 1.0.0) faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) + faraday-em_synchrony (1.0.1) faraday-excon (1.1.0) faraday-httpclient (1.0.1) - faraday-multipart (1.1.0) + faraday-multipart (1.1.1) multipart-post (~> 2.0) faraday-net_http (1.0.2) faraday-net_http_persistent (1.2.0) @@ -70,7 +70,7 @@ GEM faraday_middleware (1.2.1) faraday (~> 1.0) fastimage (2.4.0) - fastlane (2.227.2) + fastlane (2.228.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) @@ -157,8 +157,8 @@ GEM httpclient (2.9.0) mutex_m jmespath (1.6.2) - json (2.12.0) - jwt (2.10.1) + json (2.12.2) + jwt (2.10.2) base64 logger (1.7.0) mini_magick (4.13.2) @@ -167,13 +167,13 @@ GEM multipart-post (2.4.1) mutex_m (0.3.0) nanaimo (0.4.0) - naturally (2.2.1) + naturally (2.3.0) nkf (0.2.0) optparse (0.6.0) os (1.1.4) plist (3.7.2) public_suffix (6.0.2) - rake (13.2.1) + rake (13.3.0) representable (3.2.0) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) From 12f00e40ed7319ed16cced574e52460467ab3820 Mon Sep 17 00:00:00 2001 From: ACTCD <101378590+ACTCD@users.noreply.github.com> Date: Tue, 8 Jul 2025 02:30:22 +0000 Subject: [PATCH 02/37] docs: notes icloud folder guide --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d0601bfc..9f563559 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ After installing the iOS App, you need two main steps to make the extension work > > The App cannot detect whether you have enabled the extension in Safari, therefore, the App prompt will not change after you enable the extension. Currently the App interface is only used to set or change the userscripts directory. > -> You could select an iCloud folder for syncing scripts between macOS and iOS, but please note that there may be delays in synchronization, and you may encounter files be evictioned due to iCloud optimization, please refer to [#424](https://github.com/quoid/userscripts/issues/424). +> You could select an iCloud folder for syncing scripts between macOS and iOS, but please note that there may be delays in synchronization, and you may encounter files be evictioned due to iCloud optimization, please refer to [#424](https://github.com/quoid/userscripts/issues/424). (**Since macOS 15 / iOS 18, please set "keep downloaded" for the folder to avoid eviction**) There are two main ways to install a user script from the iOS version: From 7e4276042e1784a3c0747ad865cabfa760370566 Mon Sep 17 00:00:00 2001 From: ACTCD <101378590+ACTCD@users.noreply.github.com> Date: Tue, 8 Jul 2025 02:37:16 +0000 Subject: [PATCH 03/37] docs: update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f563559..269aa89b 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ After installing the iOS App, you need two main steps to make the extension work > [!NOTE] > -> The App cannot detect whether you have enabled the extension in Safari, therefore, the App prompt will not change after you enable the extension. Currently the App interface is only used to set or change the userscripts directory. +> The iOS App cannot detect whether you have enabled the extension in Safari, therefore, the App prompt will not change after you enable the extension. Currently the App interface is only used to set or change the userscripts directory. > > You could select an iCloud folder for syncing scripts between macOS and iOS, but please note that there may be delays in synchronization, and you may encounter files be evictioned due to iCloud optimization, please refer to [#424](https://github.com/quoid/userscripts/issues/424). (**Since macOS 15 / iOS 18, please set "keep downloaded" for the folder to avoid eviction**) From bb9437b5fde33e8f01ae4497e9cb77265aaea194 Mon Sep 17 00:00:00 2001 From: ACTCD <101378590+ACTCD@users.noreply.github.com> Date: Tue, 8 Jul 2025 02:49:08 +0000 Subject: [PATCH 04/37] chore: update year information --- README.md | 2 +- docs/contributing.md | 2 +- docs/dev.md | 2 +- docs/structure.md | 2 +- xcode/xcconfig/Userscripts-Release.xcconfig | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 269aa89b..09cdc78a 100644 --- a/README.md +++ b/README.md @@ -386,6 +386,6 @@ Userscripts does not collect any data from its users nor monitor activities or a ## License -Copyright (c) 2018-2024 Justin Wasack +Copyright © 2018-2025 Justin Wasack Licensed under the [GNU General Public License v3.0](/LICENSE) license for all open source applications. A commercial license is required for all other applications. diff --git a/docs/contributing.md b/docs/contributing.md index 7d09d9d4..3cb92e9d 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -117,4 +117,4 @@ If you are not a member of the project, first you need to fork the master branch # About -[Userscripts](https://github.com/quoid/userscripts) @ 2018-2023 +[Userscripts](https://github.com/quoid/userscripts) diff --git a/docs/dev.md b/docs/dev.md index 2bfa7681..262aac05 100644 --- a/docs/dev.md +++ b/docs/dev.md @@ -79,4 +79,4 @@ Note that all existing `.xcconfig` files already include `.dev.xcconfig` files o # About -[Userscripts](https://github.com/quoid/userscripts) @ 2018-2024 +[Userscripts](https://github.com/quoid/userscripts) diff --git a/docs/structure.md b/docs/structure.md index d493c3b7..1a0cd320 100644 --- a/docs/structure.md +++ b/docs/structure.md @@ -38,4 +38,4 @@ Build the project from here to extension bundled app # About -[Userscripts](https://github.com/quoid/userscripts) @ 2018-2023 +[Userscripts](https://github.com/quoid/userscripts) diff --git a/xcode/xcconfig/Userscripts-Release.xcconfig b/xcode/xcconfig/Userscripts-Release.xcconfig index 886f5a47..8c52d66b 100644 --- a/xcode/xcconfig/Userscripts-Release.xcconfig +++ b/xcode/xcconfig/Userscripts-Release.xcconfig @@ -1,6 +1,6 @@ #include "Userscripts-Base.xcconfig" -INFOPLIST_KEY_NSHumanReadableCopyright = Copyright © 2018–2024 Justin Wasack. All rights reserved. +INFOPLIST_KEY_NSHumanReadableCopyright = Copyright © 2018–2025 Justin Wasack. All rights reserved. CURRENT_PROJECT_VERSION = 1 MARKETING_VERSION = 1.0.0 From e03d49edfc621c8f43a4cab5fa28213d3d2ab975 Mon Sep 17 00:00:00 2001 From: ACTCD <101378590+ACTCD@users.noreply.github.com> Date: Tue, 8 Jul 2025 21:55:02 +0000 Subject: [PATCH 05/37] refactor: use light-dark for console log colors --- src/ext/content-scripts/entry-userscripts.js | 20 ++++++------- src/shared/colors.js | 31 +++++--------------- 2 files changed, 18 insertions(+), 33 deletions(-) diff --git a/src/ext/content-scripts/entry-userscripts.js b/src/ext/content-scripts/entry-userscripts.js index 5c0f79e7..5721dd90 100644 --- a/src/ext/content-scripts/entry-userscripts.js +++ b/src/ext/content-scripts/entry-userscripts.js @@ -1,5 +1,5 @@ import USAPI from "./api.js"; -import { getColor } from "@shared/colors.js"; +import { colors } from "@shared/colors.js"; // code received from background page will be stored in this variable // code referenced again when strict CSPs block initial injection attempt @@ -63,13 +63,13 @@ ${userscript.code} } const world = injectInto === "content" ? "content" : "page"; if (window.self === window.top) { - console.info(`Injecting: ${name} %c(js/${world})`, getColor("yellow")); + console.info(`Injecting: ${name} %c(js/${world})`, colors.yellow); } else { console.info( `Injecting: ${name} %c(js/${world})%c - %cframe(${label})(${window.location})`, - getColor("yellow"), - getColor(), - getColor("blue"), + colors.yellow, + colors.inherit, + colors.blue, ); } if (world === "page") { @@ -95,13 +95,13 @@ ${userscript.code} function injectCSS(name, code) { if (window.self === window.top) { - console.info(`Injecting ${name} %c(css)`, getColor("green")); + console.info(`Injecting ${name} %c(css)`, colors.green); } else { console.info( `Injecting ${name} %c(css)%c - %cframe(${label})(${window.location})`, - getColor("green"), - getColor(), - getColor("blue"), + colors.green, + colors.inherit, + colors.blue, ); } // Safari lacks full support for tabs.insertCSS @@ -247,7 +247,7 @@ function listeners() { for (let i = 0; i < data.files.menu.length; i++) { const item = data.files.menu[i]; if (item.scriptObject.filename === filename) { - console.info(`Injecting ${filename} %c(js)`, getColor("yellow")); + console.info(`Injecting ${filename} %c(js)`, colors.yellow); injectJS(item); return; } diff --git a/src/shared/colors.js b/src/shared/colors.js index f7162e40..71a2412f 100644 --- a/src/shared/colors.js +++ b/src/shared/colors.js @@ -1,25 +1,10 @@ -const darkModeQuery = window.matchMedia("(prefers-color-scheme: dark)"); - -let isDark = darkModeQuery.matches; - -darkModeQuery.addEventListener("change", () => { - isDark = darkModeQuery.matches; -}); - /** - * Get theme colors for console log css - * @param {string=} color + * Theme colors for console log css + * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/console#styling_console_output} */ -export function getColor(color) { - if (!color) return "color: inherit"; - const colors = { - blue: { dark: "#006fff", light: "#317eff" }, - green: { dark: "#60f36c", light: "#2bb239" }, - yellow: { dark: "#fff600", light: "#b8722c" }, - }; - if (color in colors) { - const hex = isDark ? colors[color].dark : colors[color].light; - return `color: ${hex}`; - } - return ""; -} +export const colors = { + inherit: "color: inherit", + blue: "color: light-dark( #317eff, #006fff);", + green: "color: light-dark( #2bb239, #60f36c);", + yellow: "color: light-dark( #b8722c, #fff600);", +}; From 599cc7bdc5c5cdda1a04a8b830248aa80135631b Mon Sep 17 00:00:00 2001 From: ACTCD <101378590+ACTCD@users.noreply.github.com> Date: Tue, 8 Jul 2025 21:59:41 +0000 Subject: [PATCH 06/37] chore: add a trailing semicolon --- src/shared/colors.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/colors.js b/src/shared/colors.js index 71a2412f..73d9001f 100644 --- a/src/shared/colors.js +++ b/src/shared/colors.js @@ -3,7 +3,7 @@ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/console#styling_console_output} */ export const colors = { - inherit: "color: inherit", + inherit: "color: inherit;", blue: "color: light-dark( #317eff, #006fff);", green: "color: light-dark( #2bb239, #60f36c);", yellow: "color: light-dark( #b8722c, #fff600);", From f618f01d4a46de20870134467455fc83027490ef Mon Sep 17 00:00:00 2001 From: ACTCD <101378590+ACTCD@users.noreply.github.com> Date: Mon, 21 Jul 2025 16:47:19 +0000 Subject: [PATCH 07/37] chore: fix dev public dir --- scripts/dev-safari.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/dev-safari.js b/scripts/dev-safari.js index 34943850..c9236b9f 100644 --- a/scripts/dev-safari.js +++ b/scripts/dev-safari.js @@ -186,6 +186,7 @@ async function serverCheck(url) { /** run development server */ const server = await createServer({ ...sharedConfig, + publicDir: "public/ext/vendor/", plugins: [svelte()], server: { host: true, From c4aee6442024780fd13ed4e21eb898026320e8a2 Mon Sep 17 00:00:00 2001 From: ACTCD <101378590+ACTCD@users.noreply.github.com> Date: Mon, 21 Jul 2025 16:51:40 +0000 Subject: [PATCH 08/37] fix: editor tab key restores default behavior --- src/ext/extension-page/Components/Editor/CodeMirror.svelte | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/ext/extension-page/Components/Editor/CodeMirror.svelte b/src/ext/extension-page/Components/Editor/CodeMirror.svelte index f097189b..b2cbacda 100644 --- a/src/ext/extension-page/Components/Editor/CodeMirror.svelte +++ b/src/ext/extension-page/Components/Editor/CodeMirror.svelte @@ -150,11 +150,6 @@ "Cmd-S": () => saveHandler(), "Cmd-F": () => activateSearch(), Esc: () => (searchActive = false), - Tab: (cm) => { - // convert tabs to spaces and add invisible elements - const s = Array(cm.getOption("indentUnit") + 1).join(" "); - cm.replaceSelection(s); - }, }, }); From 649157a4bbcb3e2fa5d06c5cf56d98e050258b8a Mon Sep 17 00:00:00 2001 From: ACTCD <101378590+ACTCD@users.noreply.github.com> Date: Tue, 22 Jul 2025 12:33:30 +0000 Subject: [PATCH 09/37] style: avoid the button being shrink --- src/shared/Components/IconButton.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/src/shared/Components/IconButton.svelte b/src/shared/Components/IconButton.svelte index 99751f97..52ec42cc 100644 --- a/src/shared/Components/IconButton.svelte +++ b/src/shared/Components/IconButton.svelte @@ -28,6 +28,7 @@ color: inherit; cursor: pointer; display: flex; + flex-shrink: 0; height: 1.5rem; justify-content: center; overflow: visible; From 546fdf5f0f7a48049c229d7e528e2f7f5f96e04d Mon Sep 17 00:00:00 2001 From: ACTCD <101378590+ACTCD@users.noreply.github.com> Date: Tue, 22 Jul 2025 12:35:42 +0000 Subject: [PATCH 10/37] fix: add truncate to couple element --- src/ext/extension-page/Components/Editor/Editor.svelte | 2 +- src/ext/extension-page/Components/Sidebar/SidebarItem.svelte | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ext/extension-page/Components/Editor/Editor.svelte b/src/ext/extension-page/Components/Editor/Editor.svelte index 0bdd3507..adcd67dd 100644 --- a/src/ext/extension-page/Components/Editor/Editor.svelte +++ b/src/ext/extension-page/Components/Editor/Editor.svelte @@ -173,7 +173,7 @@
{name}
-
+
{#if $v4state.includes("saving")} Saving... {:else if $v4state.includes("trashing")} diff --git a/src/ext/extension-page/Components/Sidebar/SidebarItem.svelte b/src/ext/extension-page/Components/Sidebar/SidebarItem.svelte index 266d68bc..c7c27bc7 100644 --- a/src/ext/extension-page/Components/Sidebar/SidebarItem.svelte +++ b/src/ext/extension-page/Components/Sidebar/SidebarItem.svelte @@ -42,7 +42,10 @@
{#if description} -
+
{description}
{/if} From 22b3b516e480dd1241fc0f6aa857b194b60b6603 Mon Sep 17 00:00:00 2001 From: ACTCD <101378590+ACTCD@users.noreply.github.com> Date: Tue, 22 Jul 2025 12:39:56 +0000 Subject: [PATCH 11/37] feat: activate the first script on mount --- src/ext/extension-page/Components/Sidebar/Sidebar.svelte | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ext/extension-page/Components/Sidebar/Sidebar.svelte b/src/ext/extension-page/Components/Sidebar/Sidebar.svelte index cbc62445..2c38d359 100644 --- a/src/ext/extension-page/Components/Sidebar/Sidebar.svelte +++ b/src/ext/extension-page/Components/Sidebar/Sidebar.svelte @@ -30,6 +30,8 @@ $: if (list.find((a) => a.active)) { const active = list.find((a) => a.active); scrollToEl(active.filename); + } else { + activate(list[0]); } /** From d652e573893aa58ae5c7afa79c4dfc87a9d46884 Mon Sep 17 00:00:00 2001 From: ACTCD <101378590+ACTCD@users.noreply.github.com> Date: Tue, 22 Jul 2025 12:42:51 +0000 Subject: [PATCH 12/37] refactor: split class attributes for clearer --- src/ext/extension-page/Components/Sidebar/Sidebar.svelte | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ext/extension-page/Components/Sidebar/Sidebar.svelte b/src/ext/extension-page/Components/Sidebar/Sidebar.svelte index 2c38d359..bdab0149 100644 --- a/src/ext/extension-page/Components/Sidebar/Sidebar.svelte +++ b/src/ext/extension-page/Components/Sidebar/Sidebar.svelte @@ -206,9 +206,8 @@