diff --git a/VERSIONS.md b/VERSIONS.md index c133214..3d3c46e 100644 --- a/VERSIONS.md +++ b/VERSIONS.md @@ -10,4 +10,8 @@ ## v0.6.3 * Startup sync check is now more consistent * Level number updates in realtime after sync - * Fixed bug where internal Kanji list would get reset on sync \ No newline at end of file + * Fixed bug where internal Kanji list would get reset on sync + +# v0.7 + * FuriKani now supports Firefox! + * Fixed potential innerHTML risks \ No newline at end of file diff --git a/manifest.json b/manifest.json index 09bc8c5..770898f 100644 --- a/manifest.json +++ b/manifest.json @@ -1,14 +1,14 @@ { "name": "FuriKani", "description": "Removes furigana on websites based on your WaniKani level", - "version": "0.6.3", + "version": "0.7", "icons": { "16": "res/icon16.png", "48": "res/icon48.png", "128": "res/icon128.png" }, - "manifest_version": 3, - "action": { + "manifest_version": 2, + "browser_action": { "default_popup": "src/popup.html" }, "content_scripts": [ @@ -18,7 +18,7 @@ } ], "background": { - "service_worker": "src/background.js" + "scripts": ["src/background.js"] }, "permissions": ["storage"] } \ No newline at end of file diff --git a/src/content.js b/src/content.js index e100d03..9fb24bd 100644 --- a/src/content.js +++ b/src/content.js @@ -30,10 +30,10 @@ chrome.storage.local.get(["vocabulary", "kanji", "validUserLevel", "enabled", "e if(data.enabled) { if(data.enabledVocab) - vocabStyleSheet.innerHTML = vocabStyle + vocabStyleSheet.innerText = vocabStyle if(data.enabledKanji) - kanjiStyleSheet.innerHTML = kanjiStyle + kanjiStyleSheet.innerText = kanjiStyle } const vocabulary = data.vocabulary @@ -81,15 +81,15 @@ chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => { // If everything is disabled, disable all stylsheets if(!data.enabled) { - vocabStyleSheet.innerHTML = "" - kanjiStyleSheet.innerHTML = "" + vocabStyleSheet.innerText = "" + kanjiStyleSheet.innerText = "" return } // Otherwise set the kanji and vocab stylesheets depending on their settings - vocabStyleSheet.innerHTML = data.enabledVocab ? vocabStyle : "" - kanjiStyleSheet.innerHTML = data.enabledKanji ? kanjiStyle : "" + vocabStyleSheet.innerText = data.enabledVocab ? vocabStyle : "" + kanjiStyleSheet.innerText = data.enabledKanji ? kanjiStyle : "" sendResponse(true) }) diff --git a/src/popup.html b/src/popup.html index f0e235f..1ef9b4b 100644 --- a/src/popup.html +++ b/src/popup.html @@ -6,7 +6,7 @@

FuriKani

-

v0.6.3

+

v0.7

diff --git a/src/popup.js b/src/popup.js index faf61a8..430027f 100644 --- a/src/popup.js +++ b/src/popup.js @@ -12,31 +12,31 @@ chrome.storage.local.get(["level", "token", "enabled", "enabledVocab", "enabledK // If no token is set, display exlamation mark and checkmark button if(data.token === undefined) { - statusField.innerHTML = String.fromCodePoint(0x2757) - submitButton.innerHTML = String.fromCodePoint(0x2705) + statusField.innerText = String.fromCodePoint(0x2757) + submitButton.innerText = String.fromCodePoint(0x2705) submitButton.classList.add("no-token") } else // else display checkmark and reload button { - statusField.innerHTML = String.fromCodePoint(0x2705) - submitButton.innerHTML = String.fromCodePoint(0x1F501) + statusField.innerText = String.fromCodePoint(0x2705) + submitButton.innerText = String.fromCodePoint(0x1F501) } // Display the users current WaniKani level const levelSpan = document.getElementById("level") - levelSpan.innerHTML = data.level + levelSpan.innerText = data.level // If the input field contains text that is not the current token, turn the // button into a checkmark (else turn it into a repeat button) inputField.addEventListener("input", () => { if(inputField.value !== "" && inputField.value !== data.token) { - submitButton.innerHTML = String.fromCodePoint(0x2705) + submitButton.innerText = String.fromCodePoint(0x2705) submitButton.classList.add("new-token") } else { - submitButton.innerHTML = String.fromCodePoint(0x1F501) + submitButton.innerText = String.fromCodePoint(0x1F501) submitButton.classList.remove("new-token") } }) @@ -60,25 +60,25 @@ submitButton.addEventListener( "click", () => { if(submitButton.classList.contains("no-token")) return - statusField.innerHTML = String.fromCodePoint(0x23F1) + statusField.innerText = String.fromCodePoint(0x23F1) // Sync with wanikani chrome.runtime.sendMessage("", {type: "sync"}, response => { if(response.success) { - statusField.innerHTML = String.fromCodePoint(0x2705) - errorField.innerHTML = "" + statusField.innerText = String.fromCodePoint(0x2705) + errorField.innerText = "" // Update the users current WaniKani level chrome.storage.local.get("level", (data) => { const levelSpan = document.getElementById("level") - levelSpan.innerHTML = data.level + levelSpan.innerText = data.level }) } else { - statusField.innerHTML = String.fromCodePoint(0x2757) - errorField.innerHTML = response.error + statusField.innerText = String.fromCodePoint(0x2757) + errorField.innerText = response.error } }) }) diff --git a/src/styles.css b/src/styles.css index 2ada625..a8bb4fc 100644 --- a/src/styles.css +++ b/src/styles.css @@ -4,7 +4,8 @@ padding: 0px; box-sizing: border-box; border-radius: 0px; - color: #ECB365 + color: #ECB365; + font-family: "Segoe UI", Tahoma, sans-serif; } body