Skip to content

Instantly share code, notes, and snippets.

var Chrome = require('chrome-remote-interface')
Chrome({
chooseTab: function(tabs) {
var idx = 0
tabs.forEach(function(tab, i) {
if (tab.url === 'http://localhost:9966/')
idx = i
})
return idx
@paulirish
paulirish / index.html
Created October 20, 2015 01:00 — forked from bhauman/index.html
Dynamic source map test
<html>
<head>
<script src="modifyme.js"></script>
</head>
<body>
<h1>Testing source map reloading.</h1>
<h3>Open Dev Tools and look in the console.</h3>
<p>Execute the <code>test_sm()</code> function and follow the source links.</p>
</body>
</html>
<head>
...
<meta name="viewport" content="width=device-width">
...
</head>
@paulirish
paulirish / devtools-protocol-send-command-and-monitor.md
Last active February 11, 2020 17:42 — forked from jasonLaster/inspector.js
how to issue commands and monitor the devtools protocol

Playing with the protocol

You can send arbitrary commands over the protocol fairly easily.

Main.sendOverProtocol('Emulation.setDeviceMetricsOverride', nexus5XMetrics());
Main.sendOverProtocol("Emulation.clearDeviceMetricsOverride");

// It returns a promise