Fix Edit button in highlights panel not working

I dont know why defaultView is undefined, seems like a chrome bug
This commit is contained in:
Kovid Goyal 2020-07-29 09:42:35 +05:30
parent 8eca4d7ced
commit 265a620bee
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -79,14 +79,14 @@ class ScrollViewport:
# document (body) co-ordinate system
doc = doc or window.document
topdoc = window.document
while doc is not topdoc:
while doc is not topdoc and doc.defaultView:
# We are in a frame
frame = doc.defaultView.frameElement
rect = frame.getBoundingClientRect()
x += rect.left
y += rect.top
doc = frame.ownerDocument
win = doc.defaultView
win = doc.defaultView or window
wx, wy = win.pageXOffset, win.pageYOffset
x += wx
y += wy