diff --git a/package-lock.json b/package-lock.json index a464c27..d804ea0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9285,8 +9285,7 @@ "regenerator-runtime": { "version": "0.13.7", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", - "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==", - "dev": true + "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==" }, "regenerator-transform": { "version": "0.14.5", diff --git a/package.json b/package.json index c4db1e6..83110c8 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,9 @@ "email": "mail@serraniel.dev" }, "homepage": "https://github.com/Serraniel/AniwatchPlus#readme", - "dependencies": {}, + "dependencies": { + "regenerator-runtime": "^0.13.7" + }, "devDependencies": { "@babel/compat-data": "^7.11.0", "@babel/core": "^7.11.4", diff --git a/src/javascript/enhancements/animeRequests.js b/src/javascript/enhancements/animeRequests.js index 8bf5ade..05e21fe 100644 --- a/src/javascript/enhancements/animeRequests.js +++ b/src/javascript/enhancements/animeRequests.js @@ -64,17 +64,27 @@ function removeUnknownUsers(node) { let anime = lowerDiv.innerText; let profileData = upperDiv.innerHTML; - // exchange data - upperDiv.innerHTML = `${anime}`; - // add user note if own request if (profileLink.length > 0) { - lowerDiv.innerHTML = profileData; + // Workaround to avoid innerHTML because of #38, see https://devtidbits.com/2017/12/06/quick-fix-the-unsafe_var_assignment-warning-in-javascript/ + let parser = new DOMParser(); + let parsedDocument = parser.parseFromString(profileData, 'text/html'); + + lowerDiv.innerHTML = ''; + while(parsedDocument.body.hasChildNodes()){ + lowerDiv.appendChild(parsedDocument.body.removeChild(parsedDocument.body.firstChild)); + } } // remove if foreign request. else { lowerDiv.innerHTML = ' '; } + + // exchange data + let bElement = document.createElement('b'); + bElement.textContent = anime; + upperDiv.innerHTML = ``; + upperDiv.appendChild(bElement); } if (node.tagName === targetTagName) { diff --git a/src/javascript/index.js b/src/javascript/index.js index 0eb81b4..0052b29 100644 --- a/src/javascript/index.js +++ b/src/javascript/index.js @@ -1,3 +1,5 @@ +import regeneratorRuntime from "regenerator-runtime"; + // core import { initCore } from './utils/aniwatchCore'; // helper diff --git a/src/manifests/chrome.manifest.json b/src/manifests/chrome.manifest.json index f4274d4..840d276 100644 --- a/src/manifests/chrome.manifest.json +++ b/src/manifests/chrome.manifest.json @@ -4,9 +4,6 @@ "version": "$version", "version_name": "$semanticVersion", "description": "$description", - "permissions": [ - "*://aniwatch.me/*" - ], "manifest_version": 2, "author": "$author", "homepage_url": "$homepageURL", diff --git a/src/manifests/firefox.manifest.json b/src/manifests/firefox.manifest.json index e301f42..d2d8ef7 100644 --- a/src/manifests/firefox.manifest.json +++ b/src/manifests/firefox.manifest.json @@ -3,9 +3,6 @@ "short_name": "$shortName", "version": "$version", "description": "$description", - "permissions": [ - "*://aniwatch.me/*" - ], "manifest_version": 2, "author": "$author", "developer": $developer, diff --git a/src/manifests/manifest.template.json b/src/manifests/manifest.template.json index 92d2b66..21a0f6d 100644 --- a/src/manifests/manifest.template.json +++ b/src/manifests/manifest.template.json @@ -4,9 +4,6 @@ "version": "0.1.0.0", "version_name": "0.1 Beta", "description": "Aniwatch Plus is an unofficial extension which provides several UI improvments for https://aniwatch.me.", - "permissions": [ - "*://aniwatch.me/*" - ], "manifest_version": 2, "author": "Serraniel", "developer": { diff --git a/src/manifests/opera.manifest.json b/src/manifests/opera.manifest.json index 333b31e..af4d166 100644 --- a/src/manifests/opera.manifest.json +++ b/src/manifests/opera.manifest.json @@ -4,9 +4,6 @@ "version": "$version", "version_name": "$semanticVersion", "description": "$description", - "permissions": [ - "*://aniwatch.me/*" - ], "manifest_version": 2, "author": "$author", "developer": $developer,