Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: refactor settings page and related improvements #613

Merged
merged 24 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d581e67
fix(style): cancel the use of global styles
ACTCD Dec 10, 2023
d9f52a7
fix: avoid code scroll bouncing
ACTCD Dec 15, 2023
63ccaa7
refactor: using css instead of window listener
ACTCD Dec 15, 2023
d8f01d3
fix: replace broken app launch process
ACTCD Dec 30, 2023
10abba4
chore: increase the priority of prettier
ACTCD Jan 7, 2024
9dbf6ab
refactor: adjust settings and better jsdoc
ACTCD Jan 8, 2024
ba7afea
feat: create new extension page app for ios
ACTCD Jan 8, 2024
1f79d58
refactor: extract generic modal wrapper for macos app
ACTCD Jan 8, 2024
e0a0105
feat: setup extension options page entrance
ACTCD Jan 8, 2024
a6f9d9b
refactor: introducing new match patterns parser and i18n
ACTCD Jan 8, 2024
a388190
refactor: introducing new settings component
ACTCD Jan 8, 2024
b1797e8
refactor: migrating legacy settings storage references
ACTCD Jan 11, 2024
9969729
feat: add color levels of icon button notification dot
ACTCD Jan 11, 2024
174b400
feat: add warning for global exclude all_urls
ACTCD Jan 12, 2024
654e3da
feat: add modal section navigation menus
ACTCD Jan 12, 2024
d2e8425
feat: introducing the reset settings tool
ACTCD Jan 14, 2024
3c294f1
refactor: adapt click save location buttons to ios
ACTCD Jan 14, 2024
069dd09
feat: introducing import and export settings backup
ACTCD Jan 17, 2024
1b9b898
refactor: improve settings related references and functions
ACTCD Jan 21, 2024
ac0c782
refactor: switch to slot in modal wrapper for better intellisense
ACTCD Jan 22, 2024
0935991
refactor: improve a11y of toggle button and few adjust
ACTCD Jan 23, 2024
9cb0bcf
feat: add basic traditional chinese l11n
ACTCD Jan 25, 2024
be535d4
chore: add demo build and fix basic dev mode
ACTCD Jan 27, 2024
70f7456
chore: add settings page temporary entrance for beta
ACTCD Jan 27, 2024
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
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[yaml]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
"[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
"[jsonc]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
"[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
"[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
"[css]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
"[html]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
"[svelte]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
"[markdown]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
// https://github.com/microsoft/vscode-eslint#settings-options
"eslint.validate": ["javascript", "svelte"],
"eslint.experimental.useFlatConfig": true,
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ After installing Userscripts on macOS, you **do not** need to select a userscrip
- **Show Toolbar Count** - displays a badge on the toolbar icon with a number that represents how many enabled scripts match the url for the page you are on
- **Save Location** - where your file are currently located and being saved to (click the blue text to open location)
- **Change Save Location (cogs icon)** - this button, located directly to the right of the save location, is a shortcut for opening the host app, which will allow you to change the save location
- **Global Blacklist** - this input accepts a comma separated list of [`@match` patterns](https://developer.chrome.com/docs/extensions/mv3/match_patterns/), a page url that matches against a pattern in this list will be ignored for script injection
- **Global Blacklist** - this input accepts a comma separated list of `@match` patterns ([Match pattern structure](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns#match_pattern_structure)), a page url that matches against a pattern in this list will be ignored for script injection

### Popup:

Expand All @@ -125,7 +125,7 @@ Userscripts Safari currently supports the following userscript metadata:
- `@name` - This will be the name that displays in the sidebar and be used as the filename - you can _not_ use the same name for multiple files of the same type
- `@description`- Use this to describe what your userscript does - this will be displayed in the sidebar - there is a setting to hide descriptions
- `@icon` - This doesn't have a function with this userscript manager, but the **first value** provided in the metadata will be accessible in the `GM_/GM.info` object
- `@match` - Domain match patterns - you can use several instances of this field if you'd like multiple domain matches - view [this article for more information on constructing patterns](https://developer.chrome.com/extensions/match_patterns)
- `@match` - Domain match patterns - you can use several instances of this field if you'd like multiple domain matches - please refer to: [Match pattern structure](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns#match_pattern_structure)
- **Note:** this extension only supports `http/s`
- `@exclude-match` - Domain patterns where you do _not_ want the script to run
- `@include` - Used to match against urls for injection, globs and regular expressions are allowed, [read more here](https://wiki.greasespot.net/Include_and_exclude_rules)
Expand Down Expand Up @@ -325,9 +325,7 @@ The quickest and easiest way to support the project is by [leaving a positive re

The second best way to help out is to sign up to beta test new versions of the app. Since this extension values your privacy, and **does not collect any data from users**, it is difficult to gauge how the extension is being used. By signing up to be a beta tester it not only allows you to test upcoming features, but also gives me the opportunity to elicit direct feedback from real users.

**[iOS Beta Sign Up Form](https://forms.gle/QB46uYQHVyCxULue9)**

**[macOS Beta Sign Up Form](https://forms.gle/cUDtKg1ip4Vc9Xhc7)**
**Please join and test the corresponding beta version in [releases](https://github.com/quoid/userscripts/releases) via the TestFlight public link.**

## Privacy Policy

Expand Down
3 changes: 3 additions & 0 deletions public/ext/safari-15/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"32": "images/toolbar-icon-32.png"
}
},
"options_ui": {
"page": "dist/entry-ext-extension-page.html#state=settings"
},
"content_scripts": [
{
"js": ["dist/content-scripts/userscripts.js"],
Expand Down
3 changes: 3 additions & 0 deletions public/ext/safari-16.4/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
"default_popup": "dist/entry-ext-action-popup.html",
"default_icon": "images/action.svg"
},
"options_ui": {
"page": "dist/entry-ext-extension-page.html#state=settings"
},
"content_scripts": [
{
"js": ["dist/content-scripts/userscripts.js"],
Expand Down
2 changes: 1 addition & 1 deletion public/ext/safari-dev/manifest-ios.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"default_icon": "images/action.svg"
},
"options_ui": {
"page": "dist/entry-ext-extension-page.html#settings"
"page": "dist/entry-ext-extension-page.html#state=settings"
},
"content_scripts": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/ext/safari-dev/manifest-mac.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"default_icon": "images/action.svg"
},
"options_ui": {
"page": "dist/entry-ext-extension-page.html#settings"
"page": "dist/entry-ext-extension-page.html#state=settings"
},
"content_scripts": [
{
Expand Down
234 changes: 234 additions & 0 deletions public/ext/shared/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,239 @@
"extension_description": {
"message": "Save and run javascript for the web pages you visit",
"description": "Description of what the extension does."
},
"settings": {
"message": "Settings"
},
"settings_section_editor": {
"message": "Editor Settings"
},
"settings_section_general": {
"message": "General Settings"
},
"settings_section_native": {
"message": "Native Settings"
},
"settings_section_tools": {
"message": "Tools"
},
"settings_section_about": {
"message": "About"
},
"settings_editor_auto_hint": {
"message": "Auto Hint"
},
"settings_editor_auto_hint_desc": {
"message": "Automatically shows completion hints while editing"
},
"settings_editor_close_brackets": {
"message": "Auto Close Brackets"
},
"settings_editor_close_brackets_desc": {
"message": "Toggles on/off auto closing of brackets in the editor, this affects the following characters: () [] {} \"\" ''"
},
"settings_editor_javascript_lint": {
"message": "JavaScript Linter"
},
"settings_editor_javascript_lint_desc": {
"message": "Toggles the basic javascript linting within the editor"
},
"settings_editor_list_descriptions": {
"message": "Sidebar Item Descriptions"
},
"settings_editor_list_descriptions_desc": {
"message": "Show or hides the item descriptions in the sidebar"
},
"settings_editor_list_sort": {
"message": "Sidebar Item Sort Order"
},
"settings_editor_list_sort_desc": {
"message": "Display order of items in the sidebar"
},
"settings_editor_list_sort_nameAsc": {
"message": "Scripts Name: Asc"
},
"settings_editor_list_sort_nameDesc": {
"message": "Scripts Name: Desc"
},
"settings_editor_list_sort_lastModifiedAsc": {
"message": "Last Modified: Asc"
},
"settings_editor_list_sort_lastModifiedDesc": {
"message": "Last Modified: Desc"
},
"settings_editor_show_whitespace": {
"message": "Show Whitespace Characters"
},
"settings_editor_show_whitespace_desc": {
"message": "Toggles the display of invisible characters in the editor"
},
"settings_editor_tab_size": {
"message": "Tab Size"
},
"settings_editor_tab_size_desc": {
"message": "Choose the number of spaces a tab is equal to when rendering code"
},
"settings_global_active": {
"message": "Enable Injection"
},
"settings_global_active_desc": {
"message": "Toggle on/off script injection for the pages you visit"
},
"settings_global_exclude_match": {
"message": "Global Exclude Match patterns"
},
"settings_global_exclude_match_desc": {
"message": "This input accepts a whitespace (spaces, newlines etc.) separated list of @match patterns, a page url that matches against a pattern in this list will be ignored for script injection"
},
"settings_global_exclude_match_done": {
"message": "Done"
},
"settings_global_exclude_match_saving": {
"message": "Saving..."
},
"settings_global_exclude_match_placeholder": {
"message": "list of @match patterns, for example: \n*://*/*foo.bar\n*://*/*foo.bar?*\n*://*.example.net/*\nhttps://example.net/*/foo/*/\nhttps://*.example.net/a/b/c/?foo=/"
},
"settings_global_exclude_match_refer": {
"message": "Please refer to:"
},
"settings_scripts_update_automation": {
"message": "Scripts Updates Automatically"
},
"settings_scripts_update_automation_desc": {
"message": "Script silently auto-updates in the background, which is dangerous and may introduce unconfirmed malicious code"
},
"settings_scripts_update_check_interval": {
"message": "Scripts Update Check Interval"
},
"settings_scripts_update_check_interval_desc": {
"message": "Disable or set user scripts update check interval (days)"
},
"settings_scripts_update_check_interval_0": {
"message": "Never"
},
"settings_scripts_update_check_lasttime": {
"message": "Scripts Update Check Lasttime"
},
"settings_scripts_update_check_lasttime_desc": {
"message": "The lasttime for script update check in background"
},
"settings_settings_sync": {
"message": "Sync Settings"
},
"settings_settings_sync_desc": {
"message": "Sync settings across devices"
},
"settings_toolbar_badge_count": {
"message": "Show Toolbar Count Badge"
},
"settings_toolbar_badge_count_desc": {
"message": "Displays a badge on the toolbar icon with a number that represents how many enabled scripts match the url for the page you are on"
},
"settings_scripts_directory": {
"message": "Save Location"
},
"settings_scripts_directory_desc": {
"message": "Path to the folder where user scripts are stored"
},
"settings_set_scripts_directory": {
"message": "Change save location"
},
"settings_section_tools_import": {
"message": "Import"
},
"settings_section_tools_export": {
"message": "Export"
},
"settings_section_tools_reset": {
"message": "Reset"
},
"settings_section_tools_goback": {
"message": "Go Back"
},
"settings_section_tools_reset_all": {
"message": "Reset All Settings"
},
"settings_section_tools_reset_single": {
"message": "Reset"
},
"settings_section_tools_reset_section": {
"message": "Reset Section"
},
"settings_scripts_tools_desc": {
"message": "These tools can help you import and export \"settings data\". Reset single, section or all settings."
},
"settings_about_text1": {
"message": "Get more information about this extension by visiting the open source project:"
},
"settings_about_text2": {
"message": "If you enjoy using this extension, please consider leaving a review on the App Store or sign up to beta test new versions:"
},
"settings_about_button_repo": {
"message": "Code repository"
},
"settings_about_button_docs": {
"message": "Documentation"
},
"settings_about_button_issues": {
"message": "Report bugs"
},
"settings_about_button_store": {
"message": "Open in the App Store"
},
"settings_about_button_beta": {
"message": "Sign up for beta testing"
},
"utils_check_match_patterns_0": {
"message": "The match pattern will match all URLs"
},
"utils_check_match_patterns_1": {
"message": "The scheme component should one of *, https, http"
},
"utils_check_match_patterns_2": {
"message": "The scheme and host should separated by `://`"
},
"utils_check_match_patterns_3": {
"message": "The match pattern has no path component"
},
"utils_check_match_patterns_4": {
"message": "The `*.` should followed by part of the hostname"
},
"utils_check_match_patterns_5": {
"message": "The host component length should be 1-255"
},
"utils_check_match_patterns_6": {
"message": "The `*` in host component should be independent or `*.` at the start"
},
"utils_check_match_patterns_7": {
"message": "The host component contains empty label(s)"
},
"utils_check_match_patterns_8": {
"message": "The hostname label cannot start or end with `-` character"
},
"utils_check_match_patterns_9": {
"message": "The maximum length of the hostname label cannot exceed 63"
},
"utils_check_match_patterns_10": {
"message": "The host component contains invalid character(s): $1"
},
"utils_check_match_patterns_11": {
"message": "The path component contains invalid character(s): $1"
},
"msg_invalid_match_pattern": {
"message": "Invalid match pattern"
},
"msg_invalid_backup_file": {
"message": "Not a valid backup file"
},
"msg_backup_import_finish": {
"message": "Import completed! ✅"
},
"msg_backup_import_failed": {
"message": "Import failed, please check the error log in the console"
},
"msg_settings_reset_finish": {
"message": "Reset all settings completed! ✅"
}
}
Loading
Loading