Skip to content

Commit

Permalink
Merge pull request #364 from quoid/hotfix/4.3.2
Browse files Browse the repository at this point in the history
Hotfix/4.3.2
  • Loading branch information
quoid authored Oct 31, 2022
2 parents d319eab + 3066a2b commit 06f40d0
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 24 deletions.
15 changes: 11 additions & 4 deletions extension/Userscripts Extension/Resources/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ function processJS(userscript) {
function wrapCode(preCode, code, filename) {
return `
(function() {
"use strict";
${preCode}
(function() {
const US_filename = "${filename}";
Expand Down Expand Up @@ -331,9 +330,11 @@ browser.runtime.sendMessage({name: "REQ_USERSCRIPTS"}, response => {
}
// save response locally in case CSP events occur
data = response;
// combine regular and context-menu scripts
const scripts = [...data.files.js, ...data.files.menu];
// loop through each userscript and prepare for processing
for (let i = 0; i < data.files.js.length; i++) {
const userscript = data.files.js[i];
for (let i = 0; i < scripts.length; i++) {
const userscript = scripts[i];
userscript.preCode = "";
// pass references to the api methods as needed
const gmMethods = [];
Expand Down Expand Up @@ -451,7 +452,13 @@ browser.runtime.onMessage.addListener((request, sender, sendResponse) => {
const item = data.files.menu[i];
if (item.scriptObject.filename === filename) {
console.info(`Injecting ${filename} %c(js)`, "color: #fff600");
sendResponse({code: item.code});
sendResponse({
code: wrapCode(
item.preCode,
item.code,
filename
)
});
return;
}
}
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.3.1",
"version": "4.3.2",
"icons": {
"48": "images/icon-48.png",
"96": "images/icon-96.png",
Expand Down
2 changes: 1 addition & 1 deletion extension/Userscripts Extension/Resources/page.html

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion extension/Userscripts Extension/Resources/page.js

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

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 = 35;
CURRENT_PROJECT_VERSION = 37;
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.3.1;
MARKETING_VERSION = 1.3.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 = 35;
CURRENT_PROJECT_VERSION = 37;
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.3.1;
MARKETING_VERSION = 1.3.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 = 35;
CURRENT_PROJECT_VERSION = 37;
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.3.1;
MARKETING_VERSION = 1.3.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 = 35;
CURRENT_PROJECT_VERSION = 37;
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.3.1;
MARKETING_VERSION = 1.3.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 = 62;
CURRENT_PROJECT_VERSION = 64;
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 = 12.0;
MARKETING_VERSION = 4.3.1;
MARKETING_VERSION = 4.3.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 = 62;
CURRENT_PROJECT_VERSION = 64;
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 = 12.0;
MARKETING_VERSION = 4.3.1;
MARKETING_VERSION = 4.3.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 = 62;
CURRENT_PROJECT_VERSION = 64;
DEVELOPMENT_TEAM = J74Q8V8V8N;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = Userscripts/Info.plist;
Expand All @@ -989,7 +989,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 4.3.1;
MARKETING_VERSION = 4.3.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 = 62;
CURRENT_PROJECT_VERSION = 64;
DEVELOPMENT_TEAM = J74Q8V8V8N;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = Userscripts/Info.plist;
Expand All @@ -1014,7 +1014,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 4.3.1;
MARKETING_VERSION = 4.3.2;
PRODUCT_BUNDLE_IDENTIFIER = com.userscripts.macos;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down
3 changes: 2 additions & 1 deletion src/page/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ export const validGrants = new Set([
"GM.getTab",
"GM.saveTab",
"GM_xmlhttpRequest",
"GM.xmlHttpRequest"
"GM.xmlHttpRequest",
"none"
]);

export const validKeys = new Set([
Expand Down

0 comments on commit 06f40d0

Please sign in to comment.