From 5b0d8fbba0fe3b378d3d07bba07f3cfa60608137 Mon Sep 17 00:00:00 2001 From: tophf Date: Tue, 7 Apr 2015 20:14:14 +0300 Subject: [PATCH] Show a newly installed style in popups --- popup.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/popup.js b/popup.js index 0a36e541..de1f8e62 100644 --- a/popup.js +++ b/popup.js @@ -177,6 +177,10 @@ function handleUpdate(style) { var styleElement = installed.querySelector("[style-id='" + style.id + "']"); if (styleElement) { installed.replaceChild(createStyleElement(style), styleElement); + } else if (chrome.extension.getBackgroundPage().getApplicableSections(style, location.href).length) { + // a new style for the current url is installed + document.getElementById("unavailable").style.display = "none"; + installed.appendChild(createStyleElement(style)); } }