Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#4563 closed defect (rejected)

WebSocket wrapper breaking code that extends the WebSocket object

Reported by: kzar Assignee:
Priority: Unknown Milestone:
Module: Platform Keywords:
Cc: sebastian, mapx Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description

Environment

ABP Ver: 1.12.2
Chrome 54.0.2840.71 (64-Bit)
OS X 10.11.6

Details

From this (now deleted) forum thread:

You have a breaking bug in your WrappedWebSocket's code. This will 100%
break any library that tries to extend the native WebSocket object. While I
found this issue in Chrome, I would assume that this issue extends to other
browsers as well.

I have identified the issue, on line 30 of the code you are checking if
this is an instance of WrappedWebSocket, because of how you constructed
your code it blocks the ability to extend WebSockets. Any class that would
now try extend WebSocket would get the the Window as this and not the
WrappedWebSocket's prototype, which causes them to fail your check even
though it is properly constructed.

Change History (3)

comment:1 Changed 3 years ago by sebastian

This sounds very speculative. Note that our script wrapping the WebSocket constructor will run before any script by the page can run. So the original WebSocket isn't accessible anymore, instead such a script/library would get and extend our WrappedWebSocket object.

comment:2 Changed 3 years ago by kzar

  • Resolution set to rejected
  • Status changed from new to closed

Yea, I can't figure this out either. I will mark this as rejected until the user can come back with an example of how this code is broken.

comment:3 Changed 3 years ago by mapx

however, it seems chromium guys are adding support for websockets in webrequest API
https://bugs.chromium.org/p/chromium/issues/detail?id=129353#c77
https://codereview.chromium.org/2449913002/

Note: See TracTickets for help on using tickets.