Skip to content
Permalink
Browse files

Fix the extension for Chrome

Fix title detection
Update SimpleNotification
Update domain permissions
Removed scripts minification
  • Loading branch information...
Glagan committed Mar 18, 2019
1 parent 0776556 commit bd6c288ed8b41f4f4674de707ae63fb19a59eafb
@@ -16,11 +16,12 @@ let files = {
"simpleNotification.min.js"
],
"scripts": {
".": ["defaultOptions.js"],
"minified": [
".": [
"background.js",
"defaultOptions.js",
"myMangaDex.js",
"optionsManager.js",
"sharedFunctions.js"
"sharedFunctions.js",
]
},
"icons": ["128.png", "96.png", "48.png"],
@@ -37,22 +38,8 @@ if (args[0] == "firefox" || args[0] == "f") {
}

// Options
let minify = true;
let webExt = true;

// If we don't minify we don't use the "minified" subfolder for scripts
if (args.includes("--no-minify")) {
minify = false;
files.scripts = {
".": [
"defaultOptions.js",
"myMangaDex.js",
"optionsManager.js",
"sharedFunctions.js",
]
};
}

// Don't build the web-ext artifact
if (args.includes("--no-web-ext")) {
webExt = false;
@@ -129,12 +116,6 @@ if (["firefox", "chrome"].includes(browser)) {
bundleManifestStream.cork();
bundleManifestStream.end();

// Minify script
if (minify) {
console.log("Minifying scripts");
execSync("minify");
}

// Copy files
console.log("Copying files");
deepFileCopy(files, makeFolder + "/", "");
@@ -6,8 +6,8 @@
"third_party/simpleNotification.min.js",
"scripts/defaultOptions.js",
"third_party/chrome-extension-async.js",
"scripts/minified/sharedFunctions.js",
"scripts/minified/myMangaDex.js"
"scripts/sharedFunctions.js",
"scripts/myMangaDex.js"
]
}]
}
@@ -18,8 +18,8 @@
"js": [
"third_party/simpleNotification.min.js",
"scripts/defaultOptions.js",
"scripts/minified/sharedFunctions.js",
"scripts/minified/myMangaDex.js"
"scripts/sharedFunctions.js",
"scripts/myMangaDex.js"
]
}]
}
@@ -1,14 +1,15 @@
{
"manifest_version": 2,
"name": "MyMangaDex",
"version": "2.0.7",
"version": "2.0.8",
"author": "Glagan",

"description": "Automatically update your MyAnimeList manga list when reading on MangaDex.",

"permissions": [
"*://myanimelist.net/*",
"*://*.mangadex.org/*",
"https://myanimelist.net/ownlist/manga/*",
"https://myanimelist.net/mangalist/*",
"https://*.mangadex.org/*",
"storage"
],

@@ -18,6 +19,10 @@
"128": "icons/128.png"
},

"background": {
"scripts": ["scripts/background.js"]
},

"content_scripts": [{
"matches": [
"https://*.mangadex.org/follows",

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,25 @@
// Context
window.browser = (function () {
return window.msBrowser ||
window.browser ||
window.chrome;
})();

chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
if (message.action == "fetch") {
fetch(message.url, message.options || {})
.then(async response => {
return {
url: response.url,
status: response.status,
headers: response.headers,
body: (message.isJson !== undefined && message.isJson) ? await response.json() : await response.text(),
}
})
.then(response => sendResponse(response))
.catch(error => console.error(error));
return true;
} else {
console.error("No corresponding action for this message.");
}
});

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit bd6c288

Please sign in to comment.
You can’t perform that action at this time.