fix some bugs
- Not possible to reset in firefox - draft always saved
This commit is contained in:
parent
658c40a56b
commit
548b47e896
4 changed files with 20 additions and 21 deletions
|
@ -17,8 +17,8 @@
|
|||
inkscape:version="0.92.3 (2405546, 2018-03-11)"
|
||||
sodipodi:docname="chrome_large_marquee.svg"
|
||||
inkscape:export-filename="/home/lukas/git/piwik-injector/docs/chrome_large_marquee.png"
|
||||
inkscape:export-xdpi="25.4"
|
||||
inkscape:export-ydpi="25.4">
|
||||
inkscape:export-xdpi="96.000008"
|
||||
inkscape:export-ydpi="96.000008">
|
||||
<defs
|
||||
id="defs2" />
|
||||
<sodipodi:namedview
|
||||
|
@ -30,7 +30,7 @@
|
|||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.7"
|
||||
inkscape:cx="687.79182"
|
||||
inkscape:cy="532.63759"
|
||||
inkscape:cy="361.20902"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
|
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
32
js/popup.js
32
js/popup.js
|
@ -38,7 +38,8 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
config: {
|
||||
enable: false
|
||||
},
|
||||
source: ''
|
||||
source: '',
|
||||
originalSource: chrome.i18n.getMessage("placeholder_javascript")
|
||||
},
|
||||
data: null,
|
||||
editor: {
|
||||
|
@ -245,26 +246,23 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (confirm(chrome.i18n.getMessage("delete_warning"))) {
|
||||
|
||||
chrome.storage.sync.get("hosts", function(items) {
|
||||
var hosts = items.hosts;
|
||||
var index = hosts.indexOf(popup.url);
|
||||
if (index > -1) {
|
||||
hosts.splice(index, 1);
|
||||
}
|
||||
chrome.storage.sync.set({"hosts": hosts});
|
||||
chrome.storage.sync.get("hosts", function(items) {
|
||||
var hosts = items.hosts;
|
||||
var index = hosts.indexOf(popup.url);
|
||||
if (index > -1) {
|
||||
hosts.splice(index, 1);
|
||||
}
|
||||
);
|
||||
chrome.storage.sync.set({"hosts": hosts});
|
||||
}
|
||||
);
|
||||
|
||||
chrome.storage.sync.remove(popup.url);
|
||||
chrome.storage.sync.remove(popup.url);
|
||||
|
||||
// Set-up empty data
|
||||
popup.data = Object.assign(true, {}, popup.emptyDataPattern);
|
||||
popup.applyData();
|
||||
// Set-up empty data
|
||||
popup.data = Object.assign(true, {}, popup.emptyDataPattern);
|
||||
popup.applyData();
|
||||
|
||||
popup.removeDraft();
|
||||
}
|
||||
popup.removeDraft();
|
||||
|
||||
return false;
|
||||
},
|
||||
|
|
|
@ -67,6 +67,7 @@
|
|||
chrome.storage.sync.get(website, function(obj) {
|
||||
var customjs = obj[website];
|
||||
if (customjs && customjs.config.enable) {
|
||||
console.error(customjs);
|
||||
// Script
|
||||
if (customjs.source) {
|
||||
setTimeout(function() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"manifest_version": 2,
|
||||
"name": "__MSG_extension_name__",
|
||||
"short_name": "matomo-injector",
|
||||
"version": "3.3.0",
|
||||
"version": "3.3.1",
|
||||
"author": "Lukas Winkler, xcv58, hromadadan",
|
||||
"description": "__MSG_extension_description__",
|
||||
"icons": {
|
||||
|
|
Reference in a new issue