Comment on page
Run Script
Runs Javascript in the current page
- Any variable that begins with
$
is automatically exported for use in other commands- e.g.
const $meow = 3
- Primitives (number, string, boolean)
- Arrays
- JSON objects
// Assume variable $numberOfComments has the value "12 comments"
// You want to extract just the numerical count
$numberOfComments = $numberOfComments.replace(" comments", "");
// $numberOfComments is now "12"
// Assume variable $location has the value "San Francisco, CA"
// You want to split up the city and the state
const [$city, $state] = $location.split(", ");
// $city is "San Francisco", $state is "CA"
const $html = document.documentElement.outerHTML;
The code is executed in the context of the current page which means that the page's DOM is accessible
Last modified 1yr ago