Skip to main content

shortcut-search-web

Documentation / lib/components/ShortcutSearch/shortcut-search-web

extractGoogleResultsPage()​

function extractGoogleResultsPage(document: Document): object[];

Defined in: web-app/src/lib/components/ShortcutSearch/shortcut-search-web.js:53

Extract resuls JSON object from Google results html page The results html page keeps changing so this minimizes use of classes and extracts; title, url, snippet

TODO insert these results into the Sidebar as you read to flip to next result

Parameters​

ParameterTypeDescription

document

Document

Google results HTML document object

Returns​

object[]

  • array of objects with title, url, snippet

openTabSearchWeb()​

function openTabSearchWeb(query: string, shouldOpenInBackground: boolean): void;

Defined in: web-app/src/lib/components/ShortcutSearch/shortcut-search-web.js:8

Searches Google in background tab and opens first result if on that page

Parameters​

ParameterTypeDefault valueDescription

query

string

undefined

text to search

shouldOpenInBackground

boolean

false

Returns​

void