1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

Merge pull request #1731 from philippwiesemann/fix-greasemonkey-minimize

Fix GM_listValues() not listing keys because of optimizing minimization
This commit is contained in:
David Rosca 2015-10-23 23:09:02 +02:00
commit c06fb1ee0a
2 changed files with 3 additions and 5 deletions

View File

@ -13,13 +13,11 @@ function GM_getValue(aKey, aDefault) {
}
function GM_listValues() {
var prefixLen = "%1".length;
var values = [];
var i = 0;
for (var i = 0; i < localStorage.length; i++) {
var k = localStorage.key(i);
if (k.substr(0, prefixLen) === "%1") {
values.push(k.substr(prefixLen));
if (k.indexOf("%1") === 0) {
values.push(k.replace("%1", ""));
}
}
return values;

View File

@ -1 +1 @@
function GM_deleteValue(b){localStorage.removeItem("%1"+b)}function GM_getValue(b,a){var c=localStorage.getItem("%1"+b);return null===c&&"undefined"!=typeof a?a:c}function GM_listValues(){for(var b=[],a=0,a=0;a<localStorage.length;a++){var c=localStorage.key(a);"%1"===c.substr(0,2)&&b.push(c.substr(2))}return b}function GM_setValue(b,a){localStorage.setItem("%1"+b,a)};
function GM_deleteValue(a){localStorage.removeItem("%1"+a)}function GM_getValue(a,b){var c=localStorage.getItem("%1"+a);return null===c&&"undefined"!=typeof b?b:c}function GM_listValues(){for(var a=[],b=0;b<localStorage.length;b++){var c=localStorage.key(b);0===c.indexOf("%1")&&a.push(c.replace("%1",""))}return a}function GM_setValue(a,b){localStorage.setItem("%1"+a,b)};