diff --git a/src/changelog.js b/src/changelog.js index 57c3c52..a2f3791 100644 --- a/src/changelog.js +++ b/src/changelog.js @@ -1,6 +1,10 @@ "use strict"; let changelog=`[ + {"version":"1.9.3", + "changes":["Fixed major bug"], + "changesPL":["Naprawiono poważny błąd"] + }, {"version":"1.9.2", "changes":["Added possibility to hide changes outside the scanned element #35 #41","Fixed bugs","Minor changes"], "changesPL":["Dodano możliwość ukrycia zmian poza skanowanym elementem #35 #41","Naprawiono błędy","Drobne zmiany"] diff --git a/src/manifest.json b/src/manifest.json index f42eacb..d38b25a 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "__MSG_extensionName__", "description": "__MSG_extensionDescription__", - "version": "1.9.2", + "version": "1.9.3", "default_locale": "en", "icons": { "48": "icons/icon.svg", diff --git a/src/view.js b/src/view.js index cd26c94..b792b15 100644 --- a/src/view.js +++ b/src/view.js @@ -213,7 +213,7 @@ function load(type,inspectMode){ case "light": doc=parser.parseFromString(light,"text/html"); let style=document.createElement("style"); - let cssSelector=(settings.highlightOutsideChanges)?"":sId.cssSelector; + let cssSelector=(!settings.highlightOutsideChanges&&sId.paritialMode&&sId.cssSelector)?sId.cssSelector:""; style.textContent=` ${cssSelector} .__wps_changes a{ background:#ffa !important; @@ -310,11 +310,13 @@ function load(type,inspectMode){ }else{ filteredChanges=allChanges; } - if(!settings.highlightOutsideChanges){ + if(!settings.highlightOutsideChanges&&sId.paritialMode&&sId.cssSelector){ let selectedElement=iframe.contentDocument.querySelector(sId.cssSelector); - filteredChanges=[...filteredChanges].filter((element,index,array)=>{ - return (selectedElement.contains(element)); - }); + if(selectedElement){ + filteredChanges=[...filteredChanges].filter((element,index,array)=>{ + return (selectedElement.contains(element)); + }); + } } document.getElementById("xtext").textContent=i18n("numberOfChanges",filteredChanges.length); }