Skip to content

Commit

Permalink
Fixed "new VConsole()" failed on Android 4.4 (Android 4.4 does not su…
Browse files Browse the repository at this point in the history
…pport MutationObserver).
wangzhengbo2 committed Oct 4, 2019
1 parent f4c6f5b commit 44830ec
Showing 3 changed files with 246 additions and 220 deletions.
448 changes: 236 additions & 212 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -18,13 +18,15 @@
"type": "git",
"url": "git+https://github.com/Tencent/vConsole.git"
},
"dependencies": {},
"dependencies": {
"mutation-observer": "^1.0.3"
},
"devDependencies": {
"@babel/core": "^7.5.5",
"@babel/core": "^7.6.2",
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/plugin-proposal-export-namespace-from": "^7.5.2",
"@babel/plugin-proposal-object-rest-spread": "^7.5.5",
"@babel/preset-env": "^7.5.5",
"@babel/plugin-proposal-object-rest-spread": "^7.6.2",
"@babel/preset-env": "^7.6.2",
"babel-loader": "^8.0.6",
"babel-plugin-add-module-exports": "^1.0.2",
"chai": "^4.2.0",
@@ -33,12 +35,12 @@
"html-loader": "^0.5.5",
"jsdom": "^15.1.1",
"json-loader": "^0.5.7",
"less": "^3.10.0",
"less": "^3.10.3",
"less-loader": "^5.0.0",
"mocha": "^5.2.0",
"style-loader": "^1.0.0",
"webpack": "^4.39.2",
"webpack-cli": "^3.3.6"
"webpack": "^4.41.0",
"webpack-cli": "^3.3.9"
},
"author": "Tencent",
"license": "MIT"
2 changes: 1 addition & 1 deletion src/element/element.js
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@ Unless required by applicable law or agreed to in writing, software distributed
* vConsole Element Tab
*/

import MutationObserver from 'mutation-observer'
import './style.less';
import VConsolePlugin from '../lib/plugin.js';
import tplTabbox from './tabbox.html';
@@ -33,7 +34,6 @@ class VConsoleElementsTab extends VConsolePlugin {
that.nodes = [];
that.activedElem = {}; // actived by user

let MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
that.observer = new MutationObserver(function(mutations) {
for (let i=0; i<mutations.length; i++) {
let mutation = mutations[i];

0 comments on commit 44830ec

Please sign in to comment.