aboutsummaryrefslogtreecommitdiff
path: root/html/display_panel
diff options
context:
space:
mode:
authorNateN1222 <nathannichols454@gmail.com>2017-08-03 19:04:48 -0500
committerNateN1222 <nathannichols454@gmail.com>2017-08-03 19:04:48 -0500
commit9610ce5341a735511b96a0f50cab9de25c204dbb (patch)
tree518368197d0ad9374038aa60ae7edf5601d8c696 /html/display_panel
parentfb35bc72eb77ffd462a2d9b90cc5f9a18f8d1700 (diff)
Made the browser action UI better
Diffstat (limited to 'html/display_panel')
-rw-r--r--html/display_panel/content/main_panel.js13
1 files changed, 5 insertions, 8 deletions
diff --git a/html/display_panel/content/main_panel.js b/html/display_panel/content/main_panel.js
index 880d963..8595b5a 100644
--- a/html/display_panel/content/main_panel.js
+++ b/html/display_panel/content/main_panel.js
@@ -62,7 +62,7 @@ function write_elements(data,name,color){
var button_html_3 = '<div style="float:right"><input id="temp3" type="button" value="forget preference"></input></div>';
var heading = document.getElementById(name).getElementsByTagName("h2")[0];
var list = document.getElementById(name).getElementsByTagName("ul")[0];
- if(data[name].length == 0){
+ if(data[name] === undefined || data[name].length == 0){
// default message
list.innerHTML = "<li>No "+ name +" scripts on this page.</li>"
} else{
@@ -136,13 +136,10 @@ function generate_HTML(blocked_data){
for(var i = 0; i < to_clr.length; i++){
to_clr[i].innerHTML = "";
}
-
-
write_elements(blocked_data,"accepted","green");
write_elements(blocked_data,"whitelisted","green");
write_elements(blocked_data,"blocked","red");
write_elements(blocked_data,"blacklisted","red");
-
}
myPort.onMessage.addListener(function(m) {
@@ -157,12 +154,12 @@ function onGot(tabInfo) {
var gettingCurrent = webex.tabs.getCurrent(onGot);
-
-
-
-
function print_local_storage(){
myPort.postMessage({"printlocalstorage": true});
}
+function delete_local_storage(){
+ myPort.postMessage({"deletelocalstorage":true});
+}
new_debug_button("Print local storage",print_local_storage);
+new_debug_button("Clear local storage",delete_local_storage);