diff --git a/manifest.json b/manifest.json index f56dc38..539cf0e 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "Favioli", "description": "Emoji favicons for the web", - "version": "0.3.2", + "version": "0.3.3", "background": { "scripts": [ "build/background.js" ] }, diff --git a/package.json b/package.json index dc66705..d71cf73 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "favioli", - "version": "0.3.2", + "version": "0.3.3", "author": "Ben Pevsner", "license": "Unlicense", "description": "Emoji Favicons for the web", diff --git a/source/contentScript.js b/source/contentScript.js index c06bef4..a2cbda9 100644 --- a/source/contentScript.js +++ b/source/contentScript.js @@ -9,5 +9,5 @@ getSettings().then(settings => { function updateFavicon({ name, shouldOverride }) { if (shouldOverride) removeAllFaviconLinks(); - appendFaviconLink(name); + appendFaviconLink(name, shouldOverride); } diff --git a/source/utilities/faviconHelpers.js b/source/utilities/faviconHelpers.js index 129cf66..d24bd89 100644 --- a/source/utilities/faviconHelpers.js +++ b/source/utilities/faviconHelpers.js @@ -22,19 +22,23 @@ const memoizedEmojiUrl = memoize(createEmojiUrl); /** * Given an emoji string, append it to the document head * @param {string} name + * @param {boolean} shouldOverride */ let existingFavicon = null; -export function appendFaviconLink(name) { +export function appendFaviconLink(name, shouldOverride) { const href = memoizedEmojiUrl(name); if (existingFavicon) { existingFavicon.setAttribute("href", href); } else { const link = createLink(href, EMOJI_SIZE, "image/png"); - const defaultLink = createLink("/favicon.ico"); existingFavicon = documentHead.appendChild(link); - documentHead.appendChild(defaultLink); + + if (!shouldOverride) { + const defaultLink = createLink("/favicon.ico"); + documentHead.appendChild(defaultLink); + } } }