mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 17:17:57 +01:00
Merge pull request #537 from chrisaljoudi/master
Fix `set` for Firefox & Safari (skip non-own properties in for..in loop)
This commit is contained in:
commit
e8fb45d54f
2 changed files with 6 additions and 0 deletions
|
@ -195,6 +195,9 @@ vAPI.storage = {
|
|||
var key, values = [], placeholders = [];
|
||||
|
||||
for ( key in details ) {
|
||||
if ( !details.hasOwnProperty(key) ) {
|
||||
continue;
|
||||
}
|
||||
values.push(key);
|
||||
values.push(JSON.stringify(details[key]));
|
||||
placeholders.push('?, ?');
|
||||
|
|
|
@ -126,6 +126,9 @@ vAPI.storage = {
|
|||
|
||||
set: function(details, callback) {
|
||||
for ( var key in details ) {
|
||||
if ( !details.hasOwnProperty(key) ) {
|
||||
continue;
|
||||
}
|
||||
this._storage.setItem(key, JSON.stringify(details[key]));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue