Commit Graph

32 Commits

Author SHA1 Message Date
Oliver Dunk
b25a56bf8e Add Puppeteer testing tutorial (#1016)
* Add Puppeteer testing tutorial

* Use Jest as test runner

* Add comment on changing headless mode
2023-10-12 10:49:02 -05:00
Oliver Dunk
a1c97b522e Add DevTools Tips example (#1013)
* Add DevTools Tips example

* Update functional-samples/tutorial.focus-mode-debugging/README.md

Co-authored-by: Joe Medley <jmedley@google.com>

---------

Co-authored-by: Joe Medley <jmedley@google.com>
2023-09-29 12:03:57 -07:00
Xuezhou Dai
a98b3cdb56 Add new sample: no-cookies rule manager (#986)
* init

* Add README

* Add popup

* Fix regex typo

* Remove console

* Update README

* Set manager.html as the options page

* Remove activeTab permission

* Update code

* Set ruleItem as a constant

* Use `existingRules` instead of `_rules`

* Wrapper input elements with label

* Fix viewRuleButton

* Move to functional-sample

* Update README.md

Co-authored-by: Joe Medley <jmedley@google.com>

* Update README.md

Co-authored-by: Joe Medley <jmedley@google.com>

* Update README.md

Co-authored-by: Joe Medley <jmedley@google.com>

* Update README.md

Co-authored-by: Joe Medley <jmedley@google.com>

* Update README.md

Co-authored-by: Joe Medley <jmedley@google.com>

* Update functional-samples/sample.dnr-rule-manager/README.md

Co-authored-by: Oliver Dunk <oliver@oliverdunk.com>

* Remove setSaveButtonDisabled

* Update description

* Remove document.write

* Remove nested function

* Update functional-samples/sample.dnr-rule-manager/manifest.json

---------

Co-authored-by: Joe Medley <jmedley@google.com>
Co-authored-by: Oliver Dunk <oliver@oliverdunk.com>
2023-08-22 13:01:12 +01:00
Xuezhou Dai
45bbd8d68d Update description fields for all samples (#994)
* Update `action` sample

* Update `alarms` sample

* Update `bookmarks` sample

* Update `browsingData` sample

* Update `contentSettings` sample

* Update `cookies/cookie-clearer` sample

* Update `debugger` sample

* Update wasm functional sample

* Update `functional/cookbook.geolocation-contentscript` sample

* Update `cookbook.geolocation-offscreen` sample

* Update `cookbook.geolocation-popup` sample

* Update `cookbook.offscreen-clipboard-write` sample

* Update `cookbook.offscreen-dom` sample

* Fix browsingData description

* Fix bookmarks description

* Update offscreen document descriptions

* Update descriptions

* Update browsingData description

* Update descriptions for all api samples

* Update descriptions for cookbook samples

* Update api-samples/browsingData/manifest.json

Co-authored-by: Joe Medley <jmedley@google.com>

* Update api-samples/action/manifest.json

Co-authored-by: Joe Medley <jmedley@google.com>

* Update api-samples/contextMenus/basic/manifest.json

Co-authored-by: Joe Medley <jmedley@google.com>

* Update api-samples/cookies/cookie-clearer/manifest.json

Co-authored-by: Joe Medley <jmedley@google.com>

* Update api-samples/debugger/manifest.json

Co-authored-by: Joe Medley <jmedley@google.com>

* Update functional-samples/sample.favicon-cs/manifest.json

Co-authored-by: Joe Medley <jmedley@google.com>

* Update functional-samples/cookbook.sidepanel-site-specific/manifest.json

Co-authored-by: Joe Medley <jmedley@google.com>

* Update api-samples/omnibox/new-tab-search/manifest.json

Co-authored-by: Joe Medley <jmedley@google.com>

* Update api-samples/devtools/inspectedWindow/manifest.json

Co-authored-by: Joe Medley <jmedley@google.com>

* Update api-samples/override/blank_ntp/manifest.json

Co-authored-by: Joe Medley <jmedley@google.com>

* Apply suggestions from code review

Co-authored-by: Joe Medley <jmedley@google.com>

* Update wasm samples description

* Update description

* Update functional-samples/sample.co2meter/manifest.json

Co-authored-by: Joe Medley <jmedley@google.com>

* Apply suggestions from code review

---------

Co-authored-by: Joe Medley <jmedley@google.com>
Co-authored-by: Oliver Dunk <oliver@oliverdunk.com>
2023-08-17 18:19:42 +01:00
Joe Medley
b6a3ac5501 Fix README typo (#992) 2023-08-04 11:53:23 -07:00
amysteamdev
6f2e616494 [SidePanel API] Add sidePanel.open() cookbook (#983)
* Init commit

* Add sidepanel open cookbook

* Add minimum chrome version

* Add 116 on readme

* Add extension page
Add content script

* Tweak

* Tweak 2

* ¯\_(ツ)_/¯

* Update readme

* Update readme

* Change sample name in Readme

* Bold Chrome 116 for emphasis

* Typo fix
2023-07-18 10:36:40 -06:00
Sebastian Benz
2852c64790 Add WebSocket sample (#976)
* Add WebSocket sample

This sample demonstrates how to use a websocket in a service worker.

* add minimum chrome version

* Address comments

* add more detail to the readme
* make sure glitch instance is booted

* fix spelling
2023-07-05 13:18:27 +02:00
Oliver Dunk
e8d26131bb Add sample for tabCapture using offscreen document (#974)
* Add sample for using tabCapture in offscreen document.

* Add recording item to tabCapture demo.

Adds an icon which indicates if recording is currently in
progress.

* Addressed a number of pieces of feedback.

* Apply suggestions from code review

Co-authored-by: amysteamdev <37001393+AmySteam@users.noreply.github.com>

* Add step to pin extension.

* Add comments.

---------

Co-authored-by: amysteamdev <37001393+AmySteam@users.noreply.github.com>
2023-07-04 14:31:31 +01:00
patrick kettner
622466f97c add geolocation samples (#944)
* add geolocation samples

Co-authored-by: amysteamdev <37001393+AmySteam@users.noreply.github.com>
Co-authored-by: Oliver Dunk <oliverdunk@google.com>
2023-06-20 10:03:39 -04:00
Jack Hsieh
e7c398bf93 CO2 meter extension - a sample for using WebHID on extension service worker. (#921)
* Initial README.md file

* fix design doc link

* Update README.md adding scheib

* Update README.md

* test

* update README.md with alvinjiooo

* add a ascii fish in README.md

* Update README.md

* skeloton extension

* Add original co2meter.html

* add buttons to settings page

* Initial storage module stub.

* Add storage module reference from settings page.

* Fix settings JS to be module compatible.

* Add stubs for settings storage writing

* Call saveCO2Value() from onInputReport in co2meter.html

* background page to read CO2 periodically based on the stored interval

* verion 1.0 /module/co2_meter.js

* Refactor settings.html and hook up CO2 driver

* update v2 of /module/co2_meter.js which access all methods from CO2Meter class

* Fix co2_meter import in background.js

* background page to show CO2 meter disconnected icon

* v2.1 update /module/co2_meter.js add support for virtual meter and connection listener also rquestPermission

* v2.1 update /module/co2_meter.js

* Import idb-keyval indexedDB library into storage.js, with trivial usage.

* background page handle disconnect connect device

* update v2.2 /module/co2_meter.js make  non-static and add guarding flag for exccessive reading

* update v2.3 /module/co2_meter.js await device to close before open device in

* update v2.4 /module/co2_meter.js change to return reject promise instead of Error in

* Add third-party/idb-keyval, use to set/get interval.

* Simplify settings and storage.

* handle background page device disconnect/connect

* Rename *_script.js files to only *.js.

* Add temp reading

* Add chart to popup.html with chartjs etc.

* Update extension tool tip to show connected/disconnected status.

* use indexedDB to store CO2 reading

* Renaming items in background.js

Name methods more clearly for what they are doing.
Collapse some code when possible to be inline.

* add  in Storage

* add support for storing temperature and query temperature in range

* background page boardcasting reading updated

* Refactor chart out of popup into chart.html for iframing

* Continued: chart out of popup into chart.html for iframing

* Use message channel for message broadcasting and move common constant to constant.js

* Work in progress for data into chart.

* Use set for clients in background page

* Add promise to storage constructor.

* Change IDB version number due to schema change

* Populate chart data.

* check store name before creating when version changed

* increase popup window and iframe size

* Update chart upon new data.

* Add calibration period and refactor inputReport

* Use flexbox to layout pages.

* move internal and temperature unit into setting store

* move dbInitialized into transaction oncomplete event

* remove reading out interval and temp unit log

* Remove co2meter.html

* Add .map files for third party code to remove devtools warnings.

* Display chart in Fahrenheit

* remove idb-keyvalue

* prettier storage.js and add comments to public methods

* Chart style: time axis respects time of data, no data points

* Show dialog on the chart when device is disconnected

* Add Example Data Button

* Close dialog button

* Implement toggling between Celsius / Fahrenheit

* polish co2_meter.js and remove virtual device and change default interval to 30 sec

* Change small icon to CO2 text

* change reading interval default to 30 secs which helps the chart update faster for fresh load case

* Fix lint error

* Clean up console.log

* Add chrome.alarm example

* remove keep alive for reading alarm

* refactor to keep connection open

* add README.md

* strip down

* addressed comments

* add link to README.md

---------

Co-authored-by: Vincent Scheib <scheib@users.noreply.github.com>
Co-authored-by: Alvin Ji <111466895+alvinjiooo@users.noreply.github.com>
Co-authored-by: Alvin Ji <alvinji@chromium.org>
Co-authored-by: Alpaca Jam <alvinji@google.com>
2023-06-16 20:56:03 +02:00
Sebastian Benz
73b7a456ac Add Google Analytics 4 sample (#930)
* Add Google Analytics 4 sample

* addressed comments
2023-06-15 15:16:23 +02:00
Benjamin Lörincz
48a0060ae2 rearranged methods for better readability (#899) 2023-06-13 22:00:09 +02:00
yiminghe
eea2fd1b23 Update cookbook.offscreen-clipboard-write README.md (#942) 2023-06-06 09:29:59 -05:00
amysteamdev
ee2c6fcad0 Switch to service worker (#924) 2023-05-22 09:41:06 -05:00
amysteamdev
5ffd262abc Add helpful links to WASM readme (#920) 2023-05-18 08:50:09 -05:00
Xuezhou Dai
eb6badb726 Add wasm sample (#841)
* Add wasm sample

* Add README

* Fix indent in README

* Add a sample that doesn't use module to import wasm

* fix: added new line at the end of files

* Removed sample with format marco & extra space

* No more extern crate

* Sync changes

* Added new line at the end of files

* Update output

* Update footnotes

* Removed reference for unpacked extension

* Used new README template

* Update dependencies

* Update build artifacts

* fix: typo

* Update files with latest version of rustc

---------

Co-authored-by: Oliver Dunk <oliverdunk@google.com>
2023-05-12 10:58:20 +01:00
amysteamdev
9230a50346 [Side Panel API] Add copyright to sidepanel samples (#908)
* Add copyright to sidepanel samples

* Fix year

* Add error catching
and async
2023-05-04 11:14:22 -05:00
amysteamdev
064dde640b [SidePanel API] Adds four examples (#890)
* Add global side panel

* Add multiple panes sample

* Add dictionary side panel sample

* Add google.com and action click extension

* Switch to lowercase

* Fix name

* Fix links

* Add screenshots and links

* Tweak google sp

* Remove logs

* Add install reason

* Add default title to action

* Change extension names
Update readme's

* Tweak comments
Add aside

* increase picture size

* Add screenshots

* Add spaces

* Update screenshots

* Update img size

* Refactor multiple panels

* rename action folder to site-specific

* Switch to Side Panel API

* Apply suggestions from Tech review p2

Thanks Oliver!

Co-authored-by: Oliver Dunk <oliverdunk@google.com>

* Add space
Change variable

---------

Co-authored-by: Oliver Dunk <oliverdunk@google.com>
2023-05-03 11:19:49 -05:00
Benjamin Lörincz
dc5d34f0f7 pretty print (#895)
* added json for prettier, npm run prettier in lint-staged
2023-05-01 11:29:59 -04:00
Benjamin Lörincz
e09fc71c9e moved body style to existing css file (#896) 2023-05-01 10:30:15 -04:00
Benjamin Lörincz
5431639ce2 added length to avoid error (#892)
check tabIds.length avoid error
2023-05-01 10:17:04 -04:00
Benjamin Lörincz
370685a326 removed unused variable (#898) 2023-05-01 09:48:38 -04:00
Benjamin Lörincz
ab9460ee7d removed empty background.js (#897) 2023-05-01 09:47:22 -04:00
Benjamin Lörincz
281d194a44 enhanced default_icon, pretty print (#894) 2023-05-01 09:41:11 -04:00
amysteamdev
4baa57bd47 Extension sample for Debugging Extensions tutorial (#867)
* First draft

* Update popup and options

* Update comments

* Update functional-samples/tutorial.broken-color/service-worker.js

Co-authored-by: Sebastian Benz <sebastian.benz@gmail.com>

* Add readme

* Update readme

---------

Co-authored-by: Sebastian Benz <sebastian.benz@gmail.com>
2023-03-28 13:57:59 -05:00
amysteamdev
4aa6bdb595 [SW-tutorial] Refactor alarms API logic (sw-tips.js) (#865)
* [SW-tutorial] Refactor alarms API logic

After doing some experiments (like closing all my browser windows which I never, EVER do...) I realized the tips logic was not working as expected, because [alarms do not persist across browser sessions[(https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/alarms#:~:text=Alarms%20do%20not%20persist%20across%20browser%20sessions.)

* Return storage set

* Tech review
2023-03-24 16:40:24 -05:00
amysteamdev
0cd692076e [New tutorial] Open Chrome API docs (condensed) (#851)
* First draft

* Rename folder

* Tweak comments

* Update index.html

* remove extra closing div

* Rename sw file

* Apply first round of @sebastianbenz suggestions

* Fix import

* Update popover

* Second tech review round

* Removed long list of suggestions
Only show past history

* Move host permissions

* Rename extension and folder

* REmove await

* Move icons into images folder
2023-03-22 12:05:35 -05:00
Sebastian Benz
d0dd2c3a9e Eslint: don't allow var (#856) 2023-03-20 19:36:40 +01:00
Abhilekh Gautam
3091fb8d39 Update api sample for action (#838)
* add sample for catifier that replaces every jpg image on web by another cat image

* add readme for catifier

* add section for set/get  badge text color

* add usage of isEnabled,getBadgeTextColor and setBadgeTextColor

* capitalize  button text

* use single quote and update badge text to test

* use <all_urls> host_permission
2023-03-09 16:08:28 +00:00
Sebastian Benz
1229875d30 Add offscreen dom parsing sample (#835)
* Add offscreen dom parsing sample

* Don't use offscreen.hasDocument

Use clients.matchAll instead. Also fixes a bug in the clipboard example
causing the document not to be closed if the passed argument is not a
string.

* Fix readme and remove accidentally committed popup files.
2023-03-03 14:06:43 +01:00
Sebastian Benz
dc2174377a Add prettier and eslint (#831)
* Ignores archived samples
* Uses eslint/recommended rules
* Runs prettier and eslint (including --fix) pre-commit via husky
* Adds new npm scripts: 'lint', 'lint:fix' and 'prettier'
* Does not lint inline js code
* Fix all prettier and eslint errors
* Add custom prettier rules
* Apply custom prettier rules
* Update readme to explain how to setup the repo
* addressed comments
2023-02-22 13:25:39 +01:00
Oliver Dunk
5bf419b385 Reorganize directory structure (#825)
* Remove docs folder.

This was a redirect from a GitHub pages site that does not appear
to be in use.

* Rename api folder to api-samples.

* Move examples to functional-samples folder.

* Move cookbook sample to functional-samples.

* Move tutorials to functional-samples folder.

* Move mv2 and apps folders to _archive.

* Rename tools folder to .repo.

* Move reference folder to functional-samples.

* Update README.

Update README with new relative links for reorg.

* Update README.md

Co-authored-by: amysteamdev <37001393+AmySteam@users.noreply.github.com>

---------

Co-authored-by: amysteamdev <37001393+AmySteam@users.noreply.github.com>
2023-02-03 10:58:04 -06:00