Skip to content

Loading…

Fix `set` for Firefox & Safari (skip non-own properties in for..in loop) #537

Merged
merged 1 commit into from

2 participants

@chrisaljoudi

Should fix #523

@gorhill gorhill merged commit e8fb45d into chrisaljoudi:master

1 check passed

Details continuous-integration/travis-ci The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 0 deletions.
  1. +3 −0 platform/firefox/vapi-background.js
  2. +3 −0 platform/safari/vapi-background.js
View
3 platform/firefox/vapi-background.js
@@ -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('?, ?');
View
3 platform/safari/vapi-background.js
@@ -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]));
}
Something went wrong with that request. Please try again.