Browser extension to hide view-reducing screen junk from websites.

bannerbanner/src/ background_script.js
11 lines
445 B

  1. import browser from 'webextension-polyfill'
  2. import PageActionButton from './PageActionButton'
  3. import { toggleEnabled, isEnabled, onEnabledChange } from './perOrigin'
  4. const pageActionButton = PageActionButton({
  5. icon: async tab => (await isEnabled(tab.url)) ? '/icon_enabled.svg' : '/icon_disabled.svg',
  6. title: async tab => (await isEnabled(tab.url)) ? 'Unhide banners' : 'Hide banners',
  7. onClicked: async tab => toggleEnabled(tab.url),
  8. })