Merge pull request #630 from Zsynuting/master
fix: use chromium to support deprecated customElements api
diff --git a/packages/@weex/plugins/debug/src/index.js b/packages/@weex/plugins/debug/src/index.js
index 1e2b50a..3edf8f1 100644
--- a/packages/@weex/plugins/debug/src/index.js
+++ b/packages/@weex/plugins/debug/src/index.js
@@ -71,7 +71,7 @@
headless.launchHeadless(`${config.ip}:${config.port}`, open)
})
}
- if (!config.manual) launcher.launchChrome(debuggerURL, config.REMOTE_DEBUG_PORT || 9222)
+ if (!config.manual) launcher.launchChrome(debuggerURL)
}
exports.reload = function () {
diff --git a/packages/@weex/plugins/debug/src/link/handlers/entry.js b/packages/@weex/plugins/debug/src/link/handlers/entry.js
index 9d172c6..8d46b36 100644
--- a/packages/@weex/plugins/debug/src/link/handlers/entry.js
+++ b/packages/@weex/plugins/debug/src/link/handlers/entry.js
@@ -5,8 +5,6 @@
const debuggerRouter = Router.get('debugger')
const opn = require('opn')
-
-
let heartbeatTimer
const sendHeartbeat = () => {
heartbeatTimer && clearTimeout(heartbeatTimer)
diff --git a/packages/@weex/plugins/debug/src/util/launcher.js b/packages/@weex/plugins/debug/src/util/launcher.js
index c23de96..467a98d 100644
--- a/packages/@weex/plugins/debug/src/util/launcher.js
+++ b/packages/@weex/plugins/debug/src/util/launcher.js
@@ -1,31 +1,7 @@
const opn = require('opn')
-
-const pendingList = []
-let pending = false
-const launchChrome = function (url, remoteDebugPort, wait, callback) {
- if (!pending) {
- pending = true
- url = url.replace(/[&*]/g, '\\&')
- const args = remoteDebugPort > 0 ? ['-remote-debugging-port=' + remoteDebugPort] : null
- opn(url, args, !!wait).then(cp => {
- cp.once('close', e => {
- callback && callback(null)
- if (pendingList.length > 0) {
- pending = false
- pendingList.shift()()
- }
- })
- cp.once('error', err => {
- pending = false
- callback && callback(err)
- })
- })
- }
- else {
- pendingList.push(function () {
- launchChrome(url, remoteDebugPort, wait, callback)
- })
- }
+const puppeteer = require('puppeteer')
+const launchChrome = function (url) {
+ opn(url, { app: puppeteer._launcher.executablePath() })
}
module.exports = {