chromium extension dnssec-drill ( inspired by firefox drill extension: http://www...
[mirrors/Programs.git] / plugins / chrome-extensions / dnssec-drill / background.html
diff --git a/plugins/chrome-extensions/dnssec-drill/background.html b/plugins/chrome-extensions/dnssec-drill/background.html
new file mode 100644 (file)
index 0000000..a79545f
--- /dev/null
@@ -0,0 +1,40 @@
+<html><head>
+<meta http-equiv="refresh" content="10" /> 
+</head>
+<body>
+       <embed type="application/x-system-call" id="pluginId" width="0" height="0">Plugin FAILED to load</embed>
+       <script>
+         var plugin = document.getElementById("pluginId");
+         /*var result = plugin.myPluginMethod();  // call a method in your plugin
+         console.log("my plugin returned: " + result);*/
+
+                       function doDrill(tabId, changeInfo, tab) {
+                               var domain = tab.url.match(/:\/\/(.[^/]+)/)[1];
+        chrome.pageAction.show(tabId);
+                               
+                               //alert('drill -k /etc/trusted-key.key -TD ' + domain);
+                               var ret = plugin.system('drill -k /etc/trusted-key.key -TD ' + domain);
+                               //alert(ret);
+        if(ret > 0) {
+                                       chrome.pageAction.setIcon({path:"security-low.png", tabId:tab.id});
+                                       chrome.pageAction.setTitle({tabId:tab.id, title:"DNSSEC key invalid!"});
+        } else {
+                                       chrome.pageAction.setIcon({path:"security-medium.png", tabId:tab.id});
+                                       chrome.pageAction.setTitle({tabId:tab.id, title:"DNSSEC key valid or not found..."});
+                               }
+        chrome.pageAction.show(tabId);
+                       }
+
+                 // Called when the url of a tab changes.
+      function checkForValidUrl(tabId, changeInfo, tab) {
+                               chrome.pageAction.setIcon({path:"gtk-dialog-question.png", tabId:tab.id});
+                               chrome.pageAction.setTitle({tabId:tab.id, title:"DNSSEC resolving in progress... Please wait..."});
+                               var drill = setTimeout(function() { doDrill(tabId, changeInfo, tab); }, 0);
+      };
+
+      // Listen for any changes to the URL of any tab.
+      chrome.tabs.onUpdated.addListener(checkForValidUrl);
+       </script>
+</body>
+</html>
+
This page took 0.144414 seconds and 4 git commands to generate.