]> khamidou — GitHub mirrors - electron.git/commitdiff
Guarding webview attributes against polluted Object.prototypes
authorKirk Ouimet <kirk@kirkouimet.com>
Tue, 9 Jun 2015 23:17:00 +0000 (16:17 -0700)
committerKirk Ouimet <kirk@kirkouimet.com>
Tue, 9 Jun 2015 23:17:00 +0000 (16:17 -0700)
Ran into an error with the buildParams function breaking when using a JavaScript library that modified the Object.prototype, this small fix resolves the issue.

atom/renderer/lib/web-view/web-view.coffee

index da6f55c8fe3579ffe839cbfefaf1975eb2ff4dd3..a815dc6499dc0daa9d67e9ad3518906a0f4b5d6f 100644 (file)
@@ -173,7 +173,7 @@ class WebViewImpl
     params =
       instanceId: @viewInstanceId
       userAgentOverride: @userAgentOverride
-    for attributeName, attribute of @attributes
+    for own attributeName, attribute of @attributes
       params[attributeName] = attribute.getValue()
     #  When the WebView is not participating in layout (display:none)
     #  then getBoundingClientRect() would report a width and height of 0.