Skip to content

inDoc(node, win) failed due to mismatch protocol (https and chrome-extension) #2852

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

Closed
txchen opened this issue May 11, 2016 · 3 comments
Closed
Labels

Comments

@txchen
Copy link

txchen commented May 11, 2016

Vue.js version

1.0.23

Reproduction Link

None, since it is related to chrome extension

Steps to reproduce

I am using cVim chrome-extension, it will insert <iframe src="chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh/cmdline_frame.html" id="cVim-command-frame"></iframe> into body

I am using vue-router, and it is throwing error to block the app to run:

vue.common.js:1140
Uncaught SecurityError: Blocked a frame with origin "https://xxxxx" from accessing a frame with origin "chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh".  The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "chrome-extension". Protocols must match.

It is failing at:

function inDoc(node, win) {
  win = win || window;
  var doc = win.document.documentElement;  // !!! here --> Protocols must match
  var parent = node && node.parentNode;
  var isInDoc = doc === node || doc === parent || !!(parent && parent.nodeType === 1 && doc.contains(parent));
  if (!isInDoc) {
    var frames = win.frames;
    if (frames) {
      for (var i = 0; i < frames.length; i++) {
        if (inDoc(node, frames[i])) {
          return true;
        }
      }
    }
  }
  return isInDoc;
}

What is Expected?

Even with a chrome-extension, app should run.

What is actually happening?

Due to the error, vue app is not running, giving a blank screen to users.

@txchen
Copy link
Author

txchen commented May 11, 2016

Callstack:

H   @   vue.common.js:1140
H   @   vue.common.js:1147
An.e.$mount @   vue.common.js:9423
e._init @   vue.common.js:2468
P.e._init   @   vue-router.js:1756
VueComponent    @   VM385:2
bo.build    @   vue.common.js:5815
bo.mountComponent   @   vue.common.js:5732
(anonymous function)    @   vue.common.js:5694
(anonymous function)    @   vue.common.js:5712
n   @   vue.common.js:367
e._resolveComponent @   vue.common.js:8844
bo.resolveComponent @   vue.common.js:5714
bo.setComponent @   vue.common.js:5693
bo.bind @   vue.common.js:5653
mn._bind    @   vue.common.js:8300
Ot  @   vue.common.js:6903
(anonymous function)    @   vue.common.js:6872
e._compile  @   vue.common.js:8586
An.e.$mount @   vue.common.js:9421
e._init @   vue.common.js:2468
P.e._init   @   vue-router.js:1756
VueComponent    @   VM384:2

@txchen
Copy link
Author

txchen commented May 11, 2016

Seems related to bd8c461

#2831

@yyx990803
Copy link
Member

Fixed in 1.0.24.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants