Show a newly installed style in popups

This commit is contained in:
tophf 2015-04-07 20:14:14 +03:00
parent d4382d3f08
commit 5b0d8fbba0

View File

@ -177,6 +177,10 @@ function handleUpdate(style) {
var styleElement = installed.querySelector("[style-id='" + style.id + "']"); var styleElement = installed.querySelector("[style-id='" + style.id + "']");
if (styleElement) { if (styleElement) {
installed.replaceChild(createStyleElement(style), 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));
} }
} }