Commit | Line | Data |
---|---|---|
aaa3f953 H |
1 | <html><head> |
2 | <meta http-equiv="refresh" content="10" /> | |
3 | </head> | |
4 | <body> | |
5 | <embed type="application/x-system-call" id="pluginId" width="0" height="0">Plugin FAILED to load</embed> | |
6 | <script> | |
7 | var plugin = document.getElementById("pluginId"); | |
8 | /*var result = plugin.myPluginMethod(); // call a method in your plugin | |
9 | console.log("my plugin returned: " + result);*/ | |
10 | ||
11 | function doDrill(tabId, changeInfo, tab) { | |
12 | var domain = tab.url.match(/:\/\/(.[^/]+)/)[1]; | |
13 | chrome.pageAction.show(tabId); | |
14 | ||
15 | //alert('drill -k /etc/trusted-key.key -TD ' + domain); | |
16 | var ret = plugin.system('drill -k /etc/trusted-key.key -TD ' + domain); | |
17 | //alert(ret); | |
18 | if(ret > 0) { | |
19 | chrome.pageAction.setIcon({path:"security-low.png", tabId:tab.id}); | |
20 | chrome.pageAction.setTitle({tabId:tab.id, title:"DNSSEC key invalid!"}); | |
21 | } else { | |
22 | chrome.pageAction.setIcon({path:"security-medium.png", tabId:tab.id}); | |
23 | chrome.pageAction.setTitle({tabId:tab.id, title:"DNSSEC key valid or not found..."}); | |
24 | } | |
25 | chrome.pageAction.show(tabId); | |
26 | } | |
27 | ||
28 | // Called when the url of a tab changes. | |
29 | function checkForValidUrl(tabId, changeInfo, tab) { | |
30 | chrome.pageAction.setIcon({path:"gtk-dialog-question.png", tabId:tab.id}); | |
31 | chrome.pageAction.setTitle({tabId:tab.id, title:"DNSSEC resolving in progress... Please wait..."}); | |
32 | var drill = setTimeout(function() { doDrill(tabId, changeInfo, tab); }, 0); | |
33 | }; | |
34 | ||
35 | // Listen for any changes to the URL of any tab. | |
36 | chrome.tabs.onUpdated.addListener(checkForValidUrl); | |
37 | </script> | |
38 | </body> | |
39 | </html> | |
40 |