User Tools

Site Tools


token:FrontBrowserJavaScript

**This is an old revision of the document!**

FrontBrowserJavaScript (v8+), SafariJavaScript and ChromeJavaScript Tokens

Purpose

  • Provide a quick and simple means to execute one line of JavaScript in the Front Browser, and return the results to an Action like Set Variable to Text Action.
  • For executing more than one line, use the Execute JavaScript in Front Browser Action.
  • The front browser may be the front web browser of Safari, Google Chrome, or any of the Chrome-based browsers like Brave Browser.
  • Similar Tokens exist for targeting a specific Browser. See below.

Format

Like all Tokens, this token uses % to denote it as a token, and to separate the root token from its parameter, a single line of JavaScript:
%FrontBrowserJavaScript%<One Line of JavaScript>%

Examples

1. Get All Text on Web Page

%FrontBrowserJavaScript%document.body.innerText;%

2. Get Full Page HTML

%FrontBrowserJavaScript%document.getElementsByTagName("html")[0].outerHTML;%

3. Get Text Identified by HTML tag and class

%FrontBrowserJavaScript%document.querySelector('div.someclassname').innerText;%

See Also

Tokens

Similar Tokens

token/FrontBrowserJavaScript.1694577345.txt.gz · Last modified: 2023/09/12 23:55 by peternlewis