1
0
Fork 0

piwik not found explanation

This commit is contained in:
Lukas Winkler 2017-07-08 20:10:28 +02:00
parent 8821be3dac
commit 61036153d6
5 changed files with 41 additions and 3 deletions

View file

@ -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": ""

View file

@ -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;

View file

@ -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");
});

View file

@ -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>

View file

@ -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>