mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-04 10:09:38 +02:00
Fix set
for Firefox & Safari (don't set non-own properties in for..in loop)
This commit is contained in:
parent
ab99683454
commit
5aafafd50d
@ -195,6 +195,9 @@ vAPI.storage = {
|
|||||||
var key, values = [], placeholders = [];
|
var key, values = [], placeholders = [];
|
||||||
|
|
||||||
for ( key in details ) {
|
for ( key in details ) {
|
||||||
|
if ( !details.hasOwnProperty(key) ) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
values.push(key);
|
values.push(key);
|
||||||
values.push(JSON.stringify(details[key]));
|
values.push(JSON.stringify(details[key]));
|
||||||
placeholders.push('?, ?');
|
placeholders.push('?, ?');
|
||||||
|
@ -126,6 +126,9 @@ vAPI.storage = {
|
|||||||
|
|
||||||
set: function(details, callback) {
|
set: function(details, callback) {
|
||||||
for ( var key in details ) {
|
for ( var key in details ) {
|
||||||
|
if ( !details.hasOwnProperty(key) ) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
this._storage.setItem(key, JSON.stringify(details[key]));
|
this._storage.setItem(key, JSON.stringify(details[key]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user