diff options
| author | mrmr1993 | 2015-05-10 22:21:40 +0100 |
|---|---|---|
| committer | mrmr1993 | 2015-05-10 22:21:40 +0100 |
| commit | f54a273e97e5feeae2978845b4dfc2f154445e7f (patch) | |
| tree | 8e44089fc44c9c7f1d91e5a93a8ac488f6babd70 | |
| parent | d72b36bd54915c38c4cf370dd36cec54b82f7e62 (diff) | |
| download | vimium-f54a273e97e5feeae2978845b4dfc2f154445e7f.tar.bz2 | |
Fallback to raw element instead of shadow DOM for PhantomJS
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 9d95018c..9da99018 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -330,7 +330,8 @@ setScrollPosition = (scrollX, scrollY) -> window.focusThisFrame = do -> # Create a shadow DOM wrapping the frame so the page's styles don't interfere with ours. highlightedFrameElement = document.createElement "div" - _shadowDOM = highlightedFrameElement.createShadowRoot() + # PhantomJS doesn't support createShadowRoot, so guard against its non-existance. + _shadowDOM = highlightedFrameElement.createShadowRoot?() ? highlightedFrameElement # Inject stylesheet. _styleSheet = document.createElement "style" |
