chrome-remote-multiplex
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -751,23 +751,25 @@ 'use strict'; | ||
app.get('/json/auto-close/*', function (req, res) { | ||
var id = req.originalUrl.match(/\/json\/auto-close\/(.*)$/)[1]; | ||
var proxy = t._proxies[id]; | ||
if (proxy) { | ||
if (proxy.isUnused()) { | ||
proxy.closeTarget().close(); | ||
LOG.info("Closing target " + id + " due to /json/auto-close"); | ||
res.send("Target is closing"); | ||
t.refreshTargets().then(function () { | ||
var id = req.originalUrl.match(/\/json\/auto-close\/(.*)$/)[1]; | ||
var proxy = t._proxies[id]; | ||
if (proxy) { | ||
if (proxy.isUnused()) { | ||
proxy.closeTarget().close(); | ||
LOG.info("Closing target " + id + " due to /json/auto-close"); | ||
res.send("Target is closing"); | ||
} else { | ||
proxy.autoClose = true; | ||
t.targetsById[id].autoClose = true; | ||
LOG.info("Marking target " + id + " to auto close"); | ||
res.send("Target set to auto close"); | ||
} | ||
} else { | ||
proxy.autoClose = true; | ||
t.targetsById[id].autoClose = true; | ||
LOG.info("Marking target " + id + " to auto close"); | ||
res.send("Target set to auto close"); | ||
var target = t.targetsById[id]; | ||
if (target) { | ||
target.autoClose = true; | ||
LOG.info("Marking target " + id + " to auto close after first use"); | ||
res.send("Target will close after first use"); | ||
} else res.status(500).send("Unrecognised target id " + id); | ||
} | ||
} else { | ||
var target = t.targetsById[id]; | ||
if (target) { | ||
target.autoClose = true; | ||
LOG.info("Marking target " + id + " to auto close after first use"); | ||
res.send("Target will close after first use"); | ||
} else res.status(500).send("Unrecognised target id " + id); | ||
} | ||
}); | ||
}); | ||
@@ -774,0 +776,0 @@ |
{ | ||
"name": "chrome-remote-multiplex", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "Allows multiple Chrome DevTools Clients to connect to a single Remote Debugger (ie Chrome Headless) instance", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -64,3 +64,3 @@ # chrome-remote-multiplex | ||
tracks connections and when the last one has disconnected from an instance, the instance itself is closed down. This means | ||
that even if your application crashes, the ab is cleaned up properly because the operating system will close the socket which | ||
that even if your application crashes, the tab is cleaned up properly because the operating system will close the socket which | ||
will disconnect from the MultiplexServer and then cause the tab to be removed also - this is garbage collection for your browser tabs. | ||
@@ -67,0 +67,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
89571
855