Live Demo
To view the demo pages you need:
Demo Pages
Overview
The Page Tools extension adds functionality to the Chrome DevTools. You can add UI elements on developers panel and interact with the inspected page.
Structure:
Quick Start
-
Install extension
-
Add tools page in your project, which will be displayed in DevTools frame
tools.html
-
Add link to tools page in main template file of your project.
index.html
-
Include pageToolsConnector to communicate between tools frame and main page
Include in html:
tools.html
Or using import in js file:
tools.js
tools.html
Usage
Initialize connection
Create connection in tools.html tab to communicate with main page
tools.js
.eval()
The eval() method runs the js code on main page
Syntax
Example:
tools.js
.on()
The on() method attaches handlers to events from the main page.
Syntax
Example:
tools.js
index.js
.emit()
Any event handlers attached with window.addEventListener on main page are triggered when the corresponding event occurs.
Syntax
Example:
tools.js
index.js