diff --git a/.web-extension-id b/.web-extension-id new file mode 100644 index 0000000..5b950aa --- /dev/null +++ b/.web-extension-id @@ -0,0 +1,3 @@ +# This file was created by https://github.com/mozilla/web-ext +# Your auto-generated extension ID for addons.mozilla.org is: +dictionary_anywrere_fork@tao.com \ No newline at end of file diff --git a/background/background.js b/background/background.js index f50f220..5724812 100644 --- a/background/background.js +++ b/background/background.js @@ -4,14 +4,32 @@ const GOOGLE_SPEECH_URI = 'https://www.google.com/speech-api/v1/synthesize', enabled: true }; +function getContentOfSiteCrossOrigin (url) { + return new Promise((resolve, reject) => { + const xhr = new XMLHttpRequest(); + xhr.open('GET', url, true); + xhr.onload = () => { + if (xhr.status === 200) { + resolve(xhr.responseText); + } else { + reject(xhr.statusText); + } + }; + xhr.onerror = () => { + reject(xhr.statusText); + }; + xhr.send(); + }); +} + browser.runtime.onMessage.addListener((request, sender, sendResponse) => { const { word, lang } = request, - url = `https://www.google.com/search?hl=${lang}&q=define+${word}&gl=US`; - + url = makeLink(word, lang); + fetch(url, { - method: 'GET', - credentials: 'omit' - }) + method: 'GET', + credentials: 'omit' + }) .then((response) => response.text()) .then((text) => { const document = new DOMParser().parseFromString(text, 'text/html'), @@ -29,21 +47,60 @@ browser.runtime.onMessage.addListener((request, sender, sendResponse) => { return true; }); -function extractMeaning (document, context) { +function extractMeaningFromGoogle (document) { if (!document.querySelector("[data-dobid='hdw']")) { return null; } var word = document.querySelector("[data-dobid='hdw']").textContent, - definitionDiv = document.querySelector("div[data-dobid='dfn']"), - meaning = ""; - - if (definitionDiv) { - definitionDiv.querySelectorAll("span").forEach(function(span){ - if(!span.querySelector("sup")) - meaning = meaning + span.textContent; + definitionDivNodeList = document.querySelectorAll("div[data-dobid='dfn']"), + meaningArray = []; + + if(definitionDivNodeList) { + definitionDivNodeList.forEach((definitionDiv) => { + if (definitionDiv) { + var meaning = ""; + definitionDiv.querySelectorAll("span").forEach( function(span) { + if(!span.querySelector("sup")) { + meaning = meaning + span.textContent; + } + }); + meaningArray.push(meaning); + } }); } + + for(var i = 0; i < meaningArray.length; i++) { + meaningArray[i] = meaningArray[i][0].toUpperCase() + meaningArray[i].substring(1); + } + return { word: word, meaningArray: meaningArray }; +} - meaning = meaning[0].toUpperCase() + meaning.substring(1); +function extractMeaningFromDoxonline (document) { + var targetSpan = document.querySelector(".def"); + if (!targetSpan) { return null; } + + var word = targetSpan.querySelector("b").textContent.slice(0,-1), + meaningArray = [targetSpan.innerHTML]; + + if(meaningArray[0].length > 1000) { + meaningArray[0] = meaningArray[0].substr(0, 1000) + "..."; + } + + return { word: word, meaningArray: meaningArray }; +} + + +function extractMeaning (document, context) { + var word, + meaningArray, + wordAndMeaningArray; + + if (context.lang === 'ro') { + wordAndMeaningArray = extractMeaningFromDoxonline(document); + } else { + wordAndMeaningArray = extractMeaningFromGoogle(document); + } + word = wordAndMeaningArray.word; + meaningArray = wordAndMeaningArray.meaningArray; var audio = document.querySelector("audio[jsname='QInZvb']"), source = document.querySelector("audio[jsname='QInZvb'] source"), @@ -67,21 +124,21 @@ function extractMeaning (document, context) { audioSrc = `${GOOGLE_SPEECH_URI}?${queryString}`; } - return { word: word, meaning: meaning, audioSrc: audioSrc }; + return { word: word, meaningArray: meaningArray, audioSrc: audioSrc }; }; function saveWord (content) { let word = content.word, - meaning = content.meaning, + meaningArray = content.meaningArray, storageItem = browser.storage.local.get('definitions'); storageItem.then((results) => { let definitions = results.definitions || {}; - definitions[word] = meaning; + definitions[word] = meaningArray.join(' '); browser.storage.local.set({ definitions }); }) -} \ No newline at end of file +} diff --git a/common/dictionary-links.js b/common/dictionary-links.js new file mode 100644 index 0000000..cb8bb28 --- /dev/null +++ b/common/dictionary-links.js @@ -0,0 +1,15 @@ +function makeDexonlineLink(word) { + return `https://dexonline.ro/definitie/${word}`; +} + +function makeGoogleLink(word, language) { + return `https://www.google.com/search?hl=${language}&q=define+${word}`; +} + +function makeLink(word, language) { + if(language === 'ro') { + return makeDexonlineLink(word); + } else { + return makeGoogleLink(word, language); + } +} \ No newline at end of file diff --git a/content_scripts/dictionary.js b/content_scripts/dictionary.js index fbb2595..10fa3cf 100644 --- a/content_scripts/dictionary.js +++ b/content_scripts/dictionary.js @@ -1,216 +1,239 @@ - var DEFAULT_LANGUAGE = 'en', - DEFAULT_TRIGGER_KEY = 'none', +var DEFAULT_LANGUAGE = 'en', + DEFAULT_TRIGGER_KEY = 'none', - LANGUAGE, - TRIGGER_KEY; + LANGUAGE, + TRIGGER_KEY; - function showMeaning (event){ - var createdDiv, - info = getSelectionInfo(event); +function showMeaning (event){ + var createdDiv, + info = getSelectionInfo(event); - if (!info) { return; } + if (!info) { return; } - retrieveMeaning(info) - .then((response) => { - if (!response.content) { return noMeaningFound(createdDiv); } + retrieveMeaning(info) + .then((response) => { + if (!response.content) { return noMeaningFound(createdDiv); } - appendToDiv(createdDiv, response.content); - }); - - // Creating this div while we are fetching meaning to make extension more fast. - createdDiv = createDiv(info); - } - - - function getSelectionInfo(event) { - var word; - var boundingRect; - - if (window.getSelection().toString().length > 1) { - word = window.getSelection().toString(); - boundingRect = getSelectionCoords(window.getSelection()); - } else { - return null; - } + appendToDiv(createdDiv, response.content); + }); - var top = boundingRect.top + window.scrollY, - bottom = boundingRect.bottom + window.scrollY, - left = boundingRect.left + window.scrollX; + // Creating this div while we are fetching meaning to make extension more fast. + createdDiv = createDiv(info); +} - if (boundingRect.height == 0) { - top = event.pageY; - bottom = event.pageY; - left = event.pageX; - } - return { - top: top, - bottom: bottom, - left: left, - word: word, - clientY: event.clientY, - height: boundingRect.height - }; - } +function getSelectionInfo(event) { + var word; + var boundingRect; - function retrieveMeaning(info){ - return browser.runtime.sendMessage({ word: info.word, lang: LANGUAGE, time: Date.now() }); + if (window.getSelection().toString().length > 1) { + word = window.getSelection().toString(); + boundingRect = getSelectionCoords(window.getSelection()); + } else { + return null; } - function createDiv(info) { - var hostDiv = document.createElement("div"); - - hostDiv.className = "dictionaryDiv"; - hostDiv.style.left = info.left -10 + "px"; - hostDiv.style.position = "absolute"; - hostDiv.style.zIndex = "1000000" - hostDiv.attachShadow({mode: 'open'}); - - var shadow = hostDiv.shadowRoot; - var style = document.createElement("style"); - //style.textContent = "*{ all: initial}"; - style.textContent = ".mwe-popups{background:#fff;position:absolute;z-index:110;-webkit-box-shadow:0 30px 90px -20px rgba(0,0,0,0.3),0 0 1px #a2a9b1;box-shadow:0 30px 90px -20px rgba(0,0,0,0.3),0 0 1px #a2a9b1;padding:0;font-size:14px;min-width:300px;border-radius:2px}.mwe-popups.mwe-popups-is-not-tall{width:320px}.mwe-popups .mwe-popups-container{color:#222;margin-top:-9px;padding-top:9px;text-decoration:none}.mwe-popups.mwe-popups-is-not-tall .mwe-popups-extract{min-height:40px;max-height:140px;overflow:hidden;margin-bottom:47px;padding-bottom:0}.mwe-popups .mwe-popups-extract{margin:16px;display:block;color:#222;text-decoration:none;position:relative} .mwe-popups.flipped_y:before{content:'';position:absolute;border:8px solid transparent;border-bottom:0;border-top: 8px solid #a2a9b1;bottom:-8px;left:10px}.mwe-popups.flipped_y:after{content:'';position:absolute;border:11px solid transparent;border-bottom:0;border-top:11px solid #fff;bottom:-7px;left:7px} .mwe-popups.mwe-popups-no-image-tri:before{content:'';position:absolute;border:8px solid transparent;border-top:0;border-bottom: 8px solid #a2a9b1;top:-8px;left:10px}.mwe-popups.mwe-popups-no-image-tri:after{content:'';position:absolute;border:11px solid transparent;border-top:0;border-bottom:11px solid #fff;top:-7px;left:7px} .audio{background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAcUlEQVQ4y2P4//8/AyUYQhAH3gNxA7IAIQPmo/H3g/QA8XkgFiBkwHyoYnRQABVfj88AmGZcTuuHyjlgMwBZM7IE3NlQGhQe65EN+I8Dw8MLGgYoFpFqADK/YUAMwOsFigORatFIlYRElaRMWmaiBAMAp0n+3U0kqkAAAAAASUVORK5CYII=);background-position: center;background-repeat: no-repeat;cursor:pointer;margin-left: 8px;opacity: 0.5; width: 16px; display: inline-block;} .audio:hover {opacity: 1;}"; - shadow.appendChild(style); + var top = boundingRect.top + window.scrollY, + bottom = boundingRect.bottom + window.scrollY, + left = boundingRect.left + window.scrollX; - var encapsulateDiv = document.createElement("div"); - encapsulateDiv.style = "all: initial; text-shadow: transparent 0px 0px 0px, rgba(0,0,0,1) 0px 0px 0px !important;"; - shadow.appendChild(encapsulateDiv); + if (boundingRect.height == 0) { + top = event.pageY; + bottom = event.pageY; + left = event.pageX; + } + return { + top: top, + bottom: bottom, + left: left, + word: word, + clientY: event.clientY, + height: boundingRect.height + }; +} - var popupDiv = document.createElement("div"); - popupDiv.style = "font-family: arial,sans-serif; border-radius: 12px; border: 1px solid #a2a9b1; box-shadow: 0 0 17px rgba(0,0,0,0.5)"; - encapsulateDiv.appendChild(popupDiv); +function retrieveMeaning(info){ + return browser.runtime.sendMessage({ word: info.word, lang: LANGUAGE, time: Date.now() }); +} +function createDiv(info) { + var hostDiv = document.createElement("div"); - var contentContainer = document.createElement("div"); - contentContainer.className = "mwe-popups-container"; - popupDiv.appendChild(contentContainer); + hostDiv.className = "dictionaryDiv"; + hostDiv.style.left = info.left -10 + "px"; + hostDiv.style.position = "absolute"; + hostDiv.style.zIndex = "1000000" + hostDiv.attachShadow({mode: 'open'}); + var shadow = hostDiv.shadowRoot; + var style = document.createElement("style"); + //style.textContent = "*{ all: initial}"; + style.textContent = ".mwe-popups{background:#fff;position:absolute;z-index:110;-webkit-box-shadow:0 30px 90px -20px rgba(0,0,0,0.3),0 0 1px #a2a9b1;box-shadow:0 30px 90px -20px rgba(0,0,0,0.3),0 0 1px #a2a9b1;padding:0;font-size:14px;min-width:400px;border-radius:2px}.mwe-popups.mwe-popups-is-not-tall{width:420px}.mwe-popups .mwe-popups-container{color:#222;margin-top:-9px;padding-top:9px;text-decoration:none}.mwe-popups.mwe-popups-is-not-tall .mwe-popups-extract{min-height:40px;max-height:140px;overflow:hidden;margin-bottom:47px;padding-bottom:0}.mwe-popups .mwe-popups-extract{margin:16px;display:block;color:#222;text-decoration:none;position:relative} .mwe-popups.flipped_y:before{content:'';position:absolute;border:8px solid transparent;border-bottom:0;border-top: 8px solid #a2a9b1;bottom:-8px;left:10px}.mwe-popups.flipped_y:after{content:'';position:absolute;border:11px solid transparent;border-bottom:0;border-top:11px solid #fff;bottom:-7px;left:7px} .mwe-popups.mwe-popups-no-image-tri:before{content:'';position:absolute;border:8px solid transparent;border-top:0;border-bottom: 8px solid #a2a9b1;top:-8px;left:10px}.mwe-popups.mwe-popups-no-image-tri:after{content:'';position:absolute;border:11px solid transparent;border-top:0;border-bottom:11px solid #fff;top:-7px;left:7px} .audio{background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAcUlEQVQ4y2P4//8/AyUYQhAH3gNxA7IAIQPmo/H3g/QA8XkgFiBkwHyoYnRQABVfj88AmGZcTuuHyjlgMwBZM7IE3NlQGhQe65EN+I8Dw8MLGgYoFpFqADK/YUAMwOsFigORatFIlYRElaRMWmaiBAMAp0n+3U0kqkAAAAAASUVORK5CYII=);background-position: center;background-repeat: no-repeat;cursor:pointer;margin-left: 8px;opacity: 0.5; width: 16px; display: inline-block;} .audio:hover {opacity: 1;}"; + shadow.appendChild(style); + var encapsulateDiv = document.createElement("div"); + encapsulateDiv.style = "all: initial; text-shadow: transparent 0px 0px 0px, rgba(0,0,0,1) 0px 0px 0px !important;"; + shadow.appendChild(encapsulateDiv); - var content = document.createElement("div"); - content.className = "mwe-popups-extract"; - content.style = "line-height: 1.4; margin-top: 0px; margin-bottom: 11px; max-height: none"; - contentContainer.appendChild(content); + var popupDiv = document.createElement("div"); + popupDiv.style = "font-family: arial,sans-serif; border-radius: 12px; border: 1px solid #a2a9b1; box-shadow: 0 0 17px rgba(0,0,0,0.5)"; + encapsulateDiv.appendChild(popupDiv); - var heading = document.createElement("h3"); - heading.style = "margin-block-end: 0px; display:inline-block;"; - heading.textContent = "Searching"; - var meaning = document.createElement("p"); - meaning.style = "margin-top: 10px"; - meaning.textContent = "Please Wait..."; + var contentContainer = document.createElement("div"); + contentContainer.className = "mwe-popups-container"; + popupDiv.appendChild(contentContainer); - var audio = document.createElement("div"); - audio.className = "audio"; - audio.innerHTML = " "; - audio.style.display = "none"; - var moreInfo =document.createElement("a"); - moreInfo.href = `https://www.google.com/search?hl=${LANGUAGE}&q=define+${info.word}`; - moreInfo.style = "float: right; text-decoration: none;" - moreInfo.target = "_blank"; - content.appendChild(heading); - content.appendChild(audio); - content.appendChild(meaning); - content.appendChild(moreInfo); - document.body.appendChild(hostDiv); + var content = document.createElement("div"); + content.className = "mwe-popups-extract"; + content.style = "line-height: 1.4; margin-top: 0px; margin-bottom: 11px; max-height: none"; + contentContainer.appendChild(content); - if(info.clientY < window.innerHeight/2){ - popupDiv.className = "mwe-popups mwe-popups-no-image-tri mwe-popups-is-not-tall"; - hostDiv.style.top = info.bottom + 10 + "px"; - if(info.height == 0){ - hostDiv.style.top = parseInt(hostDiv.style.top) + 8 + "px"; - } - } else { - popupDiv.className = "mwe-popups flipped_y mwe-popups-is-not-tall"; - hostDiv.style.top = info.top - 10 - popupDiv.clientHeight + "px"; - if(info.height == 0){ - hostDiv.style.top = parseInt(hostDiv.style.top) - 8 + "px"; - } - } + var heading = document.createElement("h3"); + heading.style = "margin-block-end: 0px; display:inline-block;"; + heading.textContent = "Searching"; - return { - heading, - meaning, - moreInfo, - audio - }; + var meaning = document.createElement("p"); + meaning.style = "margin-top: 10px"; + meaning.textContent = "Please Wait..."; - } + var audio = document.createElement("div"); + audio.className = "audio"; + audio.innerHTML = " "; + audio.style.display = "none"; - function getSelectionCoords(selection) { - var oRange = selection.getRangeAt(0); //get the text range - var oRect = oRange.getBoundingClientRect(); - return oRect; + var moreInfo =document.createElement("a"); + if(LANGUAGE == "ro") { + moreInfo.href = `https://dexonline.ro/definitie/${info.word}`; + } else { + moreInfo.href = makeLink(info.word, LANGUAGE); } - - function appendToDiv(createdDiv, content){ - var hostDiv = createdDiv.heading.getRootNode().host; - var popupDiv = createdDiv.heading.getRootNode().querySelectorAll("div")[1]; - - var heightBefore = popupDiv.clientHeight; - createdDiv.heading.textContent = content.word; - createdDiv.meaning.textContent = content.meaning; - createdDiv.moreInfo.textContent = "More »"; - - var heightAfter = popupDiv.clientHeight; - var difference = heightAfter - heightBefore; - - - if(popupDiv.classList.contains("flipped_y")){ - hostDiv.style.top = parseInt(hostDiv.style.top) - difference + 1 + "px"; + moreInfo.style = "float: right; text-decoration: none;" + moreInfo.target = "_blank"; + + content.appendChild(heading); + content.appendChild(audio); + content.appendChild(meaning); + content.appendChild(moreInfo); + document.body.appendChild(hostDiv); + + if(info.clientY < window.innerHeight/2){ + popupDiv.className = "mwe-popups mwe-popups-no-image-tri mwe-popups-is-not-tall"; + hostDiv.style.top = info.bottom + 10 + "px"; + if(info.height == 0){ + hostDiv.style.top = parseInt(hostDiv.style.top) + 8 + "px"; } + } else { + popupDiv.className = "mwe-popups flipped_y mwe-popups-is-not-tall"; + hostDiv.style.top = info.top - 10 - popupDiv.clientHeight + "px"; - if(content.audioSrc){ - var sound = document.createElement("audio"); - sound.src = content.audioSrc; - createdDiv.audio.style.display = "inline-block"; - createdDiv.audio.addEventListener("click", function(){ - sound.play(); - }); + if(info.height == 0){ + hostDiv.style.top = parseInt(hostDiv.style.top) - 8 + "px"; } } - function noMeaningFound (createdDiv){ - createdDiv.heading.textContent = "Sorry"; - createdDiv.meaning.textContent = "No definition found."; + return { + heading, + meaning, + moreInfo, + audio + }; + +} + +function getSelectionCoords(selection) { + var oRange = selection.getRangeAt(0); //get the text range + var oRect = oRange.getBoundingClientRect(); + return oRect; +} + +function meaningArrayToParagraphList(meaningArray) { + var meaningList = document.createElement("ul"); + meaningList.style = "margin-top: 0px; margin-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; padding-bottom: 0px;"; + meaningArray.forEach(function(meaning) { + var meaningItem = document.createElement("li"); + meaningItem.style = "margin-block-start: 0px; margin-block-end: 0px; display: list-item;"; + meaningItem.innerHTML = meaning; + meaningList.appendChild(meaningItem); + }); + return meaningList; +} + + +function appendToDiv(createdDiv, content){ + var hostDiv = createdDiv.heading.getRootNode().host; + var popupDiv = createdDiv.heading.getRootNode().querySelectorAll("div")[1]; + + var heightBefore = popupDiv.clientHeight; + createdDiv.heading.textContent = content.word; + createdDiv.meaning.textContent = ""; + createdDiv.meaning.appendChild(meaningArrayToParagraphList(content.meaningArray)); + createdDiv.moreInfo.textContent = "More »"; + + var heightAfter = popupDiv.clientHeight; + var difference = heightAfter - heightBefore; + + + if(popupDiv.classList.contains("flipped_y")){ + hostDiv.style.top = parseInt(hostDiv.style.top) - difference + 1 + "px"; } - function removeMeaning(event){ - var element = event.target; - if(!element.classList.contains("dictionaryDiv")){ - document.querySelectorAll(".dictionaryDiv").forEach(function(Node){ - Node.remove(); - }); - } + if(content.audioSrc){ + var sound = document.createElement("audio"); + sound.src = content.audioSrc; + createdDiv.audio.style.display = "inline-block"; + createdDiv.audio.addEventListener("click", function(){ + sound.play(); + }); } +} + +function noMeaningFound (createdDiv){ + createdDiv.heading.textContent = "Sorry"; + createdDiv.meaning.textContent = "No definition found."; +} + +function removeMeaning(event){ + var element = event.target; + if(!element.classList.contains("dictionaryDiv")){ + document.querySelectorAll(".dictionaryDiv").forEach(function(Node){ + Node.remove(); + }); + } +} - document.addEventListener('dblclick', ((e) => { - if (TRIGGER_KEY === 'none') { - return showMeaning(e); - } +document.addEventListener('dblclick', ((e) => { + updateLanguageAndTriggerKey(); + if (TRIGGER_KEY === 'none') { + return showMeaning(e); + } - //e has property altKey, shiftKey, cmdKey representing they key being pressed while double clicking. - if(e[`${TRIGGER_KEY}Key`]) { - return showMeaning(e); - } + //e has property altKey, shiftKey, cmdKey representing they key being pressed while double clicking. + if(e[`${TRIGGER_KEY}Key`]) { + return showMeaning(e); + } - return; - })); + return; +})); - document.addEventListener('click', removeMeaning); +document.addEventListener('click', removeMeaning); - (function () { - let storageItem = browser.storage.local.get(); +function updateLanguageAndTriggerKey() { + let storageItem = browser.storage.local.get(); - storageItem.then((results) => { - let interaction = results.interaction || { dblClick: { key: DEFAULT_TRIGGER_KEY }}; + storageItem.then((results) => { + let interaction = results.interaction || { dblClick: { key: DEFAULT_TRIGGER_KEY }}; + LANGUAGE = results.language || DEFAULT_LANGUAGE; + console.log("++++++++++++"+LANGUAGE); + TRIGGER_KEY = interaction.dblClick.key; + }); +} - LANGUAGE = results.language || DEFAULT_LANGUAGE; - TRIGGER_KEY = interaction.dblClick.key; - }); - })(); +(function () { + updateLanguageAndTriggerKey(); +})(); diff --git a/icons/Dictionary-32.png b/icons/Dictionary-32.png new file mode 100644 index 0000000..4851f54 Binary files /dev/null and b/icons/Dictionary-32.png differ diff --git a/manifest.json b/manifest.json index afb3465..b7d9a21 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "manifest_version": 2, "name": "Dictionary Anywhere", - "version": "1.1.0", + "version": "1.1.2", "description": "View definitions easily as you browse the web. Double-click any word to view its definition in a small pop-up bubble.", @@ -14,16 +14,11 @@ "128": "icons/Dictionary-128.png" }, - "options_ui": { - "page": "options/options.html", - "browser_style": true, - "chrome_style": true - }, - "content_scripts": [ { "matches": [""], "js": [ + "common/dictionary-links.js", "common/browser-polyfill.js", "content_scripts/dictionary.js" ] @@ -32,14 +27,27 @@ "background": { "scripts": [ + "common/dictionary-links.js", "common/browser-polyfill.js", "background/background.js" ], "persistent": false }, + "browser_action": { + "default_icon": "icons/Dictionary-32.png", + "default_title": "Dictionary Anywhere", + "default_popup": "popup/options.html" + }, + "permissions": [ "storage", - "https://www.google.com/" - ] + "https://www.google.com/", + "https://dexonline.ro/" + ], + "browser_specific_settings": { + "gecko": { + "id": "dictionary_anywrere_fork@tao.com" + } + } } diff --git a/options/options.css b/popup/options.css similarity index 99% rename from options/options.css rename to popup/options.css index 0cdb728..71df3c7 100644 --- a/options/options.css +++ b/popup/options.css @@ -8,7 +8,7 @@ body { border-radius: 3px; margin: 40px auto 0; padding: 20px 40px 30px; - width: 650px + width: 500px } #title { diff --git a/options/options.html b/popup/options.html similarity index 98% rename from options/options.html rename to popup/options.html index d1ff023..8b90ec2 100644 --- a/options/options.html +++ b/popup/options.html @@ -20,6 +20,7 @@ + diff --git a/options/options.js b/popup/options.js similarity index 98% rename from options/options.js rename to popup/options.js index d8750ba..ee248d4 100644 --- a/options/options.js +++ b/popup/options.js @@ -18,6 +18,7 @@ const DEFAULT_LANGUAGE = 'en', function saveOptions(e) { + console.log(document.querySelector("#language-selector").value) browser.storage.local.set({ language: document.querySelector("#language-selector").value, interaction: {