piwik not found explanation
This commit is contained in:
parent
8821be3dac
commit
61036153d6
5 changed files with 41 additions and 3 deletions
|
@ -7,6 +7,18 @@
|
|||
"message": "This page uses Piwik",
|
||||
"description": "text shown in popup when clicked on button in navigation bar"
|
||||
},
|
||||
"popupExplaination": {
|
||||
"message": "Open the developer tools to debug the tracking code",
|
||||
"description": ""
|
||||
},
|
||||
"piwikNotFoundHeading": {
|
||||
"message": "The piwik tracking code couldn't be found.",
|
||||
"description": ""
|
||||
},
|
||||
"piwikNotFound": {
|
||||
"message": "Check if ...",
|
||||
"description": ""
|
||||
},
|
||||
"piwikUsesHTTPS_true": {
|
||||
"message": "Is HTTPS",
|
||||
"description": ""
|
||||
|
|
12
js/panel.js
12
js/panel.js
|
@ -49,6 +49,18 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
port.onMessage.addListener(function(message) {
|
||||
if (message.action === 'injectResponse') {
|
||||
data.inject = message.data;
|
||||
var piwikNotFoundHeading = document.getElementById("piwikNotFoundHeading");
|
||||
var piwikNotFound = document.getElementById("piwikNotFound");
|
||||
if (!data.inject) {
|
||||
piwikNotFoundHeading.innerText = chrome.i18n.getMessage("piwikNotFoundHeading");
|
||||
piwikNotFound.innerText = chrome.i18n.getMessage("piwikNotFound");
|
||||
piwikNotFound.style.display = "inline-block";
|
||||
piwikNotFoundHeading.style.display = "inline-block";
|
||||
} else {
|
||||
piwikNotFound.style.display = "none";
|
||||
piwikNotFoundHeading.style.display = "none";
|
||||
|
||||
}
|
||||
// port.postMessage(message);
|
||||
} else if (message.action === "requestResponse" && message.file) {
|
||||
data.request[message.file] = message.data;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.getElementById("text").innerHTML = chrome.i18n.getMessage("popup_text");
|
||||
document.getElementById("popupExplaination").innerHTML = chrome.i18n.getMessage("popupExplaination");
|
||||
});
|
|
@ -3,13 +3,20 @@
|
|||
<link rel="stylesheet" href="../bootstrap/css/bootstrap-reboot.min.css">
|
||||
<link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css">
|
||||
<!--<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>-->
|
||||
|
||||
<style>
|
||||
button {
|
||||
position: absolute;
|
||||
top:5px;
|
||||
right:5px;
|
||||
}
|
||||
</style>
|
||||
<script src="../js/panel.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h2>DevTools panel</h2>
|
||||
<button id="start">Static Test</button>
|
||||
<h2>Piwik Checker <span id="piwikNotFoundHeading" class="badge badge-warning"></span></h2>
|
||||
<p id="piwikNotFound"></p>
|
||||
<button class="btn btn-secondary" id="start">Reload</button>
|
||||
<table class="table"></table>
|
||||
<pre id="json"></pre>
|
||||
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
<html>
|
||||
<head>
|
||||
<script src="../js/popup.js"></script>
|
||||
<style>
|
||||
body {
|
||||
min-width: 300px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2 id="text"></h2>
|
||||
<p id="popupExplaination"></p>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Reference in a new issue