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

Fixed insertcss/js path resolution for Firefox #419

Merged
merged 1 commit into from
Nov 8, 2022
Merged
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
12 changes: 7 additions & 5 deletions src/data/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ function activateDomain(hostname, tabId, frameId) {
executeScript({
tabId,
frameId,
file: `data/js/${commonJSHandlers[cachedRule.j]}.js`,
file: `/data/js/${commonJSHandlers[cachedRule.j]}.js`,
});
status = true;
}
Expand All @@ -484,7 +484,7 @@ function doTheMagic(tabId, frameId, anotherTry) {

// Common CSS rules
insertCSS(
{ tabId, frameId: frameId || 0, file: "data/css/common.css" },
{ tabId, frameId: frameId || 0, file: "/data/css/common.css" },
function () {
// A failure? Retry.
if (chrome.runtime.lastError) {
Expand All @@ -504,7 +504,7 @@ function doTheMagic(tabId, frameId, anotherTry) {
}

// Common social embeds
executeScript({ tabId, frameId, file: "data/js/embedsHandler.js" });
executeScript({ tabId, frameId, file: "/data/js/embedsHandler.js" });

if (activateDomain(tabList[tabId].hostname, tabId, frameId || 0)) {
return;
Expand All @@ -522,7 +522,7 @@ function doTheMagic(tabId, frameId, anotherTry) {
executeScript({
tabId,
frameId,
file: "data/js/0_defaultClickHandler.js",
file: "/data/js/0_defaultClickHandler.js",
});
}
);
Expand Down Expand Up @@ -588,7 +588,9 @@ chrome.runtime.onMessage.addListener(async (request, info, sendResponse) => {
}
} else {
if (request.command == "open_options_page") {
chrome.tabs.create({ url: chrome.runtime.getURL("data/options.html") });
chrome.tabs.create({
url: chrome.runtime.getURL("/data/options.html"),
});
}
}
} else if (request == "update_settings") {
Expand Down