Purescript bindings for the Chrome extenstion APIs.
- Tabs
- chrome.tabs.get
- chrome.tabs.getCurrent
- chrome.tabs.getAllInWindow
- chrome.tabs.query
- History
- chrome.history.search
- chrome.history.getVisits
- chrome.history.addUrl
- chrome.history.deleteUrl
- chrome.hisotry.deleteAll
- Events
- Perminssion, Manifest and Version compile-time checks
- Runtime
- Storage
- Management
- Commands
This logs the 1st tab in the current window, if it exists.
module Main where
import Prelude
import Chrome.Tabs (getTab)
import Data.Maybe
import Effect.Class.Console
import Effect.Aff (launchAff_)
main :: Effect Unit
main = launchAff_ do
currentTab <- getTab 1
case currentTab of
Just tab -> liftEffect $ log tab.url
Nothing -> pure unit
Runs when extension is clicked and default popup opens. Log will be visible on inspecting the popup element