Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,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** - all domain patterns listed here will be *globally* ignored for script injection
- **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

### Popup:

Expand Down Expand Up @@ -130,7 +130,7 @@ Userscripts Safari currently supports the following userscript metadata:
- `@exclude` - Functions in a similar way as `@include` but rather than injecting, a match against this key's value will prevent injection
- `@inject-into` - allows the user to choose which context to inject the script into
- allows the user to choose which context to inject the script into
- values: `auto`, `content` (default), `page`
- values: `auto` (default), `content`, `page`
- `GM` apis are only available when using `content`
- works like [violentmonkey](https://violentmonkey.github.io/api/metadata-block/#inject-into)
- `@run-at`
Expand Down
4 changes: 2 additions & 2 deletions extension/Userscripts Extension/Functions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1272,12 +1272,12 @@ func getCode(_ filenames: [String], _ isTop: Bool)-> [String: Any]? {
weight = normalizeWeight(weight)

// get inject-into and set default if missing
var injectInto = metadata["inject-into"]?[0] ?? "content"
var injectInto = metadata["inject-into"]?[0] ?? "auto"
let injectVals: Set<String> = ["auto", "content", "page"]
let runAtVals: Set<String> = ["context-menu", "document-start", "document-end", "document-idle"]
// if either is invalid use default value
if !injectVals.contains(injectInto) {
injectInto = "content"
injectInto = "auto"
}
if !runAtVals.contains(runAt) {
runAt = "document-end"
Expand Down
2 changes: 2 additions & 0 deletions extension/Userscripts Extension/Resources/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ function addApis({userscripts, uid, scriptHandler, scriptHandlerVersion}) {
api += `\nconst US_info = ${JSON.stringify(scriptData)}`;
api += "\nconst GM_info = US_info;";
gmMethods.push("info: US_info");
// if @grant explicitly set to none, empty grants array
if (grants.includes("none")) grants.length = 0;
// loop through each @grant for the userscript, add methods as needed
for (let j = 0; j < grants.length; j++) {
const grant = grants[j];
Expand Down
2 changes: 1 addition & 1 deletion extension/Userscripts Extension/Resources/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ browser.runtime.sendMessage({name: "REQ_USERSCRIPTS", uid: uid}, response => {
for (let i = 0; i < data.files.js.length; i++) {
const userscript = data.files.js[i];
if (
userscript.scriptObject?.grants?.length
userscript.scriptObject?.grants?.length >= 1
&& (
userscript.scriptObject["inject-into"] === "auto"
|| userscript.scriptObject["inject-into"] === "page"
Expand Down
2 changes: 1 addition & 1 deletion extension/Userscripts Extension/Resources/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"default_locale": "en",
"name": "__MSG_extension_name__",
"description": "__MSG_extension_description__",
"version": "4.2.1",
"version": "4.2.2",
"icons": {
"48": "images/icon-48.png",
"96": "images/icon-96.png",
Expand Down
32 changes: 16 additions & 16 deletions extension/Userscripts.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_ENTITLEMENTS = "Userscripts-iOS/Userscripts-iOS.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 26;
CURRENT_PROJECT_VERSION = 27;
DEVELOPMENT_TEAM = J74Q8V8V8N;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "Userscripts-iOS/Info.plist";
Expand All @@ -679,7 +679,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.2.1;
MARKETING_VERSION = 1.2.2;
OTHER_LDFLAGS = (
"-framework",
SafariServices,
Expand All @@ -704,7 +704,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_ENTITLEMENTS = "Userscripts-iOS/Userscripts-iOS.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 26;
CURRENT_PROJECT_VERSION = 27;
DEVELOPMENT_TEAM = J74Q8V8V8N;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "Userscripts-iOS/Info.plist";
Expand All @@ -720,7 +720,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.2.1;
MARKETING_VERSION = 1.2.2;
OTHER_LDFLAGS = (
"-framework",
SafariServices,
Expand All @@ -743,7 +743,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_ENTITLEMENTS = "Userscripts-iOS Extension/Userscripts-iOS Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 26;
CURRENT_PROJECT_VERSION = 27;
DEVELOPMENT_TEAM = J74Q8V8V8N;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "Userscripts-iOS Extension/Info.plist";
Expand All @@ -755,7 +755,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.2.1;
MARKETING_VERSION = 1.2.2;
OTHER_LDFLAGS = (
"-framework",
SafariServices,
Expand All @@ -776,7 +776,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_ENTITLEMENTS = "Userscripts-iOS Extension/Userscripts-iOS Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 26;
CURRENT_PROJECT_VERSION = 27;
DEVELOPMENT_TEAM = J74Q8V8V8N;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "Userscripts-iOS Extension/Info.plist";
Expand All @@ -788,7 +788,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.2.1;
MARKETING_VERSION = 1.2.2;
OTHER_LDFLAGS = (
"-framework",
SafariServices,
Expand Down Expand Up @@ -929,7 +929,7 @@
CODE_SIGN_ENTITLEMENTS = "Userscripts Extension/Userscripts Extension.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 54;
CURRENT_PROJECT_VERSION = 55;
DEVELOPMENT_TEAM = J74Q8V8V8N;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "Userscripts Extension/Info.plist";
Expand All @@ -939,7 +939,7 @@
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 4.2.1;
MARKETING_VERSION = 4.2.2;
PRODUCT_BUNDLE_IDENTIFIER = "com.userscripts.macos.Userscripts-Extension";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -953,7 +953,7 @@
CODE_SIGN_ENTITLEMENTS = "Userscripts Extension/Userscripts Extension.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 54;
CURRENT_PROJECT_VERSION = 55;
DEVELOPMENT_TEAM = J74Q8V8V8N;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "Userscripts Extension/Info.plist";
Expand All @@ -963,7 +963,7 @@
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 4.2.1;
MARKETING_VERSION = 4.2.2;
PRODUCT_BUNDLE_IDENTIFIER = "com.userscripts.macos.Userscripts-Extension";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -980,7 +980,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 54;
CURRENT_PROJECT_VERSION = 55;
DEVELOPMENT_TEAM = J74Q8V8V8N;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = Userscripts/Info.plist;
Expand All @@ -989,7 +989,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 4.2.1;
MARKETING_VERSION = 4.2.2;
PRODUCT_BUNDLE_IDENTIFIER = com.userscripts.macos;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -1005,7 +1005,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 54;
CURRENT_PROJECT_VERSION = 55;
DEVELOPMENT_TEAM = J74Q8V8V8N;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = Userscripts/Info.plist;
Expand All @@ -1014,7 +1014,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 4.2.1;
MARKETING_VERSION = 4.2.2;
PRODUCT_BUNDLE_IDENTIFIER = com.userscripts.macos;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"stylelint": "^14.1.0",
"stylelint-config-html": "^1.0.0",
"stylelint-config-standard": "^24.0.0",
"svelte": "^3.29.0"
"svelte": "^3.49.0"
},
"dependencies": {
"sirv-cli": "^1.0.6"
Expand Down
2 changes: 1 addition & 1 deletion src/page/Components/Settings.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
{ #if blacklistSaving}{@html iconLoader}{/if}
</div>
<textarea
placeholder="Comma separated domain patterns"
placeholder="Comma separated list of @match patterns"
spellcheck="false"
bind:this={blacklist}
value={blacklisted}
Expand Down