Commit Graph

1591 Commits

Author SHA1 Message Date
Xuezhou Dai
bbcd025851 Migration tabs sample (#964)
* Add pin sample

* Add README.md

* Add screenshot sample

* Add README.md

* Add zoom sample

* Add README.md

* Add inspector sample

* Add README.md

* Fix typo

* Remove wrapper

* Remove inline style

* Update api-samples/tabs/pin/README.md

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

* Update api-samples/tabs/screenshot/README.md

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

* Update api-samples/tabs/zoom/README.md

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

* Update api-samples/tabs/zoom/README.md

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

* Update api-samples/tabs/zoom/README.md

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

* Update api-samples/tabs/zoom/README.md

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

* Update api-samples/tabs/inspector/README.md

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

* Update api-samples/tabs/zoom/README.md

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

* Update README

* Update for loop

* Remove children select

* Change selected to active

* Fix event listener

* Set checkboxs to disabled

* Fix layout

* Fix wrong input data in create tab function

* Update api-samples/tabs/zoom/README.md

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

* Update description

* Update description

* Update description

* Fix typo

* Update description

* Rename

* Fix file name

* Update active check box

* Update code style

* Update api-samples/tabs/zoom/README.md

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

* Update api-samples/tabs/pin/README.md

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

* Update api-samples/tabs/pin/README.md

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

* Apply suggestions from code review

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

* Update api-samples/tabs/inspector/manifest.json

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

* Fix case issues

* Update api-samples/tabs/inspector/manifest.json

---------

Co-authored-by: Joe Medley <jmedley@google.com>
Co-authored-by: Oliver Dunk <oliver@oliverdunk.com>
2023-11-13 13:35:41 +00:00
Enrico Bacis
38f60eb2d4 Allow rule creation in sample.dnr-rule-manager when no rule exists (#1029)
The `functional-samples/sample.dnr-rule-manager` example allows the user to add and remove `chrome.declarativeNetRequest` rules on demand from the extension's options page.

Rules require to have a unique `id`, so the extension fetches the list of all the currently defined rules, takes the max and adds 1.

When no rule is defined, this results in `Math.max(...[]) + 1` => `Math.max() + 1` => `-Infinity + 1` => `-Infinity` and since the `id` should be an integer and not an number, the extension throws an error.

Ensuring that `0` is always a parameter of `Math.max` should solve the problem.
2023-11-13 13:27:09 +00:00
dependabot[bot]
5be3966b66 Bump word-wrap from 1.2.3 to 1.2.5 (#991)
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.5.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.5)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-13 13:23:20 +00:00
dependabot[bot]
f0c95d16ca Bump @babel/traverse in /.repo/sample-list-generator (#1018)
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.22.5 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-13 13:22:59 +00:00
dependabot[bot]
114ca0663b Bump @babel/traverse in /functional-samples/tutorial.puppeteer (#1019)
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.23.0 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-13 13:22:35 +00:00
dependabot[bot]
0587b2f3c6 Bump semver from 6.3.0 to 6.3.1 in /.repo/sample-list-generator (#990)
Bumps [semver](https://github.com/npm/node-semver) from 6.3.0 to 6.3.1.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v6.3.1/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v6.3.0...v6.3.1)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-13 13:20:57 +00:00
patrick kettner
9aaa5ca358 remove note about MV3 samples "being prepared" (#1025) 2023-11-02 13:49:50 +01:00
Oliver Dunk
0aa6d711a0 Add File Handling API / file_handlers sample (#1024)
* Initial file_handlers demo

* Fix code and update README with correct UI text

* Update README with screenshot

* Add minimum_chrome_version field

* Apply suggestions from code review

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

* Apply suggestions from code review

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

---------

Co-authored-by: amysteamdev <37001393+AmySteam@users.noreply.github.com>
Co-authored-by: Joe Medley <jmedley@google.com>
2023-11-01 19:49:32 +00:00
Oliver Dunk
31439d3b4e Add API sample for User Scripts API (#1023)
* Add API sample for User Scripts API

* Apply suggestions from code review

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

* Use chrome.userScripts.update method

* Filter getScripts call

* Add minimum_chrome_version

* Apply suggestions from code review

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

---------

Co-authored-by: Joe Medley <jmedley@google.com>
Co-authored-by: amysteamdev <37001393+AmySteam@users.noreply.github.com>
2023-11-01 14:02:18 -05:00
Oliver Dunk
f98ff8227c Add Reading List API sample (#1021)
* Add Reading List API sample

* Apply suggestions from code review

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

* Add minimum_chrome_version

---------

Co-authored-by: amysteamdev <37001393+AmySteam@users.noreply.github.com>
2023-11-01 14:13:45 +00:00
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
Benjamin Lörincz
477973e48e removed unused variables, switched to async/await, cleanup (#906)
* removed unused variables, switched to async/await, cleanup

* leave decision to await promise to caller
2023-10-10 15:37:11 +02: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
amysteamdev
c12328728d Add new sample page to README.md (#1007)
* Update README.md

* Update README.md

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

---------

Co-authored-by: Joe Medley <jmedley@google.com>
2023-09-19 15:31:54 -05:00
Xuezhou Dai
f608c65e61 Add new omnibox sample (#988)
* Add new omnibox sample

* Update api-samples/omnibox/simple-example/README.md

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

* Update api-samples/omnibox/simple-example/README.md

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

* Update api-samples/omnibox/simple-example/README.md

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

* Update api-samples/omnibox/simple-example/README.md

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

* Update api-samples/omnibox/simple-example/README.md

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

* Update description

* Update description

* Rename the global variable

---------

Co-authored-by: Joe Medley <jmedley@google.com>
2023-08-25 16:09:05 +01: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
3f07ceec66 Add storage sample (#947)
* Add storage sample `stylizr`

* Update description

* Update api-samples/storage/stylizr/README.md

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

* Clear previous timer if message called twice

* Remove innerHTML

* Update tips

* Remove IIFE

---------

Co-authored-by: Joe Medley <jmedley@google.com>
2023-08-21 11:34:27 +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
Xuezhou Dai
5addd58519 Add sample list generator action script (#989)
* Add action config

* Fix wrong working directory

* Fix relative path issue
2023-08-01 15:04:34 +01:00
Xuezhou Dai
9d9272809b Add scripts for generating sample list (#963)
* init project

* init .gitignore

* Add main scripts

* Add prefetch script

* Add extension-apis.json

* Add README.md

* Update comments

* Add newline to .gitignore

* Update type definition

* Update extension api json loading.

* Update README.md

* Update deps

* Pin deps versions

* Update extension-apis.json

* Update prefetch script

* Update script

* Remove type definitions prefix

* Add comment to auto generated json

* Split utils

* Update types

* Add manifest utils

* refactor

* Reject if there is a babel error.

* Add parallel support

* Remove redundant import

* loadExtensionApis execute synchronously

* Add test deps

* Fix unexpected result

* Add test scripts

* Update type definition

* Add start function

* Rename api variable

* Fix test

* Update getApiType method

* Remove singularize

* Fix loadExtensionApis return signature

* Remove parallel controller

* Update type definition

* Add comments

* Update types

* Update api detector

* Fix api test

* Add more test cases

* Remove `$special` key

* Fix typo

* Simplify code

* Rename `apiType` to `type`

* Add warning if no api found

* Rename variable

* Update getFullMemberExpression

* Remove the special case for `chrome.storage`.

* Add getManifest function

* Revoke changes

* Fix crash caused by incorrect folder detection

* Remove redundant import

* Check property type with typedoc

* Add action

* Fix wrong node version

* Update code

* Rename variable

* Remove unnecessary Map

* Update README

* Fix typo

* Remove unnecessary output

* Add comments

* Remove the judgment on storage API.

* Update test case

* Update comments

* Extract `getAllJsFile()` into the filesystem util

* Explain how to run the tests in README

* Pin deps

* Extract variable

* Extract `isDirectory()` into the filesystem util

* Remove assertion

* Update the parameter of `extractApiCalls()`

* Update tests

* Remove action
2023-08-01 10:00:30 +01: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
Xuezhou Dai
a3966b4d92 Add readme files to existing samples & fix typos (#981)
* Add `Running this extension` section

* Change title

* Fix title typo

* Fix wrong operation

* Update `Running this extension` section

* Add `Running this extension` section
2023-07-17 10:05:43 -06:00
Matthew Molloy
9d93ff18e3 fix extension by renaming file (#984) 2023-07-17 10:04:33 -06:00
kyoyoung keum
b6b19104fc fix rename file in debugger example app (#985)
Co-authored-by: keumky2 <keumky2@woowahan.com>
2023-07-15 09:58:19 -04:00
Xuezhou Dai
50e377c44c Add idle sample (#961)
* Add idle sample

* Fix typo

* Fix onStateChanged threshold

* Add README.md

* Update file structure

* Remove tabs permission

* Update api-samples/idle/README.md

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

* Update api-samples/idle/service-worker.js

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

* Update api-samples/idle/README.md

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

* Update api-samples/idle/README.md

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

---------

Co-authored-by: amysteamdev <37001393+AmySteam@users.noreply.github.com>
2023-07-07 15:42:14 +01:00
Xuezhou Dai
b4a018418d historyOverride sample for mv3 (#945)
* Add historyOverride sample

* Remove action

* Add README.md

* Remove IIFE

* Update style

* Fix double click
2023-07-07 15:35:03 +01:00
Xuezhou Dai
0af7b5132d Add topsites/basic sample (#967)
* Update sample file structure.

* Update description

* Fix wrong favicon path

* Add basic sample

* Update README.md

* Fix comments
2023-07-06 11:19:56 +01: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
Abhi G
327718cc14 Resolved the broken links (#975) 2023-07-03 15:55:11 +01:00
IanStanion-google
05b8106ce5 Adds readme files for every mv3 sample (#973)
* Adds readme files for every mv3 sample

* Update api-samples/alarms/README.md

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

* Update api-samples/alarms/README.md

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

* Update api-samples/override/blank_ntp/README.md

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

* Update api-samples/omnibox/new-tab-search/README.md

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

* Update api-samples/omnibox/new-tab-search/README.md

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

* Update api-samples/contextMenus/global_context_search/README.md

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

* Update api-samples/cookies/cookie-clearer/README.md

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

* Update api-samples/default_command_override/README.md

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

* Update api-samples/il8n/README.md

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

* Update api-samples/il8n/README.md

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

* Update api-samples/default_command_override/README.md

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

* Update api-samples/favicon/README.md

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

* Update api-samples/favicon/README.md

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

* Update api-samples/override/blank_ntp/README.md

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

* Update api-samples/fontSettings/fontSettings Basic/README.md

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

* Update README.md

* Update api-samples/fontSettings/fontSettings Basic/README.md

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

* Updates omnibox sample with small clarity improvement

---------

Co-authored-by: Joe Medley <jmedley@google.com>
2023-06-30 14:13:53 -04:00
IanStanion-google
307da41987 Changes onInstalled event listener to action.onClicked (#971)
* Changes onInstalled event listener to action.onClicked

* Update sandbox.html

* Update sandbox.html
2023-06-30 04:21:28 -04:00
Joe Medley
7e067289c4 Copy edit the privacy README. (#970) 2023-06-28 09:25:08 -07:00
IanStanion-google
ef7eb4cd1a Privacy mv3 sample (#956)
* Implemented mv3 privacy API sample

* Added mv3 privacy API sample

* Expanded sample and updated readme

* Update service-worker.js
2023-06-26 15:57:14 +02:00
IanStanion-google
be334066a2 Devtools mv3 samples (#938)
* devtools sample

* Added readme

* Updated readme

* Changed folder structure

* Update devtools.html

* Update devtools.js

* Update devtools.js

* Update api-samples/devtools/chrome-query/chrome-query.md

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

* Changed folder name

* readme name change

---------

Co-authored-by: Joe Medley <jmedley@google.com>
2023-06-23 10:08:52 -04:00
IanStanion-google
2527b666a6 Windows api mv3 sample (#959)
* WIP windows API sample

* Update background.js

* Added mv3 windows API sample

* Corrections based on review
2023-06-21 21:01:39 +02:00
IanStanion-google
cd11c730ea Web nav mv3 sample (#958)
* implemented webNavigation mv3 sample

* Added mv3 webNavigation API sample

* Changes based on review
2023-06-21 20:57:59 +02:00
IanStanion-google
0af4863057 Top sites mv3 sample (#957)
* Implemented topsites API sample

* Added topSites mv3 API sample

* Changes based on review
2023-06-21 20:57:18 +02:00
IanStanion-google
29806df1b2 Added mv3 bookmarks API sample (#955)
* Added mv3 bookmarks API sample

* Changes based on review
2023-06-21 20:56:16 +02:00
IanStanion-google
2f74f5563f Debugger (#950)
* Implement debugger API mv3 sample

* Expands the debugger sample to make use of captured network data

* Update manifest.json

* Create README.md

* Update README.md
2023-06-21 20:55:20 +02:00
IanStanion-google
e9c3f98ce7 Rich notifications sample (#949)
* WIP notifications API sample

* Update background.js

* Add image folder from chrome apps sample

* Added mv3 rich notifications sample

* Reworked Notification sample

* Removed deprecated API use
2023-06-21 20:54:23 +02:00
IanStanion-google
0cb5580bcd Mv3 font settings sample (#960)
* mv3 updated fontSettings sample

* Added mv3 sample for fontSettings

* Implemented simplified font settings sample

* Update popup.js
2023-06-21 20:51:31 +02:00
IanStanion-google
c6088ff5ab Browsing data mv3 sample (#954)
* WIP implementation of an mv3 updated browsingData sample

* Update popup.js

* Implements mv3 browsingData sample

* Corrections based on review
2023-06-21 20:31:07 +02:00
IanStanion-google
41e3f968a5 Added readme and licensing (#953) 2023-06-20 11:58:08 -04: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
Mehdi Baneshi
75b4501cd0 Update README.md (#913)
spell checking issue
changed  "to" => "two " ,
with accordance to context
2023-06-13 11:46:17 -05:00