Skip to content

morpheus-14/purescript-chrome

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

purescript-chrome

Purescript bindings for the Chrome extenstion APIs.

Currently Supported Methods

  • 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

Upcoming Support

Quick Start

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

About

Purescript bindings for the chrome extension api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published