Skip to content

Commit 93f202d

Browse files
shershen08yyx990803
authored andcommitted
Update detector.js (vuejs#240)
* Update detector.js added findVueRootNode method to avoid prototype.js error vuejs#171 * Update detector.js removed the 'console.log' line * Update detector.js fix linting * Update detector.js use .call directly rather than prototype * update pr
1 parent dedb8c3 commit 93f202d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

shells/chrome/src/detector.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ window.addEventListener('message', e => {
77
function detect (win) {
88
setTimeout(() => {
99
const all = document.querySelectorAll('*')
10-
const el = [].find.call(all, e => e.__vue__)
10+
let el
11+
for (let i = 0; i < all.length; i++) {
12+
if (all[i].__vue__) {
13+
el = all[i]
14+
break
15+
}
16+
}
1117
if (el) {
1218
let Vue = Object.getPrototypeOf(el.__vue__).constructor
1319
while (Vue.super) {

0 commit comments

Comments
 (0)