117 Commits

Author SHA1 Message Date
Sebastian Benz
4ffe03c811 Add missing readme files. Fixes #798 (#1616) 2026-01-26 15:35:56 +01:00
Oliver Dunk
36f42978b8 Update Puppeteer tutorial to open popup with openPopup() (#1613)
Updates the Puppeteer tutorial to use the `action.openPopup()`
method to open the popup, and then `asPage()` to access the popup
as a page target.

A basic service worker has been added to the history sample to
give us a context to call `action.openPopup()` in.
2026-01-20 12:29:34 +01:00
Sebastian Benz
85f721f5a9 Improve Gemini samples (#1611)
* Migrate to latest version of the language model

* Update readme to better describe the sample.

* More readme updates

* Consistent API naming and format lists
2026-01-15 13:38:00 +01:00
Rin
99ba96e67c security: restrict content script matches to specific domain in favicon sample (#1610)
* security: restrict content script matches to specific domain instead of <all_urls>

* docs: update README to reflect domain restriction
2026-01-08 14:11:55 +00:00
Rin
ddf0e9ae8a security: use activeTab instead of <all_urls> to follow principle of least privilege (#1608) 2026-01-08 13:12:33 +00:00
Oliver Dunk
2862740483 Use <number>.<number> format for Google Analytics client ID (#1606)
* Use <number>.<number> format for Google Analytics client ID

With the `ENFORCE_RECOMMENDATIONS` [validation behavior](https://developers.google.com/analytics/devguides/collection/protocol/ga4/validating-events?client_type=firebase#send_events_for_validation), Google Analytics warns about client IDs not in the <number>.<number> format.

This is not an issue in practice - that recommendation is for compatibility with existing client IDs and events are still processed with a client ID in any format. Additionally, the validation is not enabled by default.

However, this PR updates our sample code to use a consistent ID regardless to reduce noise if the validation is enabled. We use a random ID concatenated with a UNIX timestamp to match other GA client libraries.

* Run eslint
2026-01-07 15:19:18 +00:00
gmf-uah
5dad4a4879 Update README.md (#1527)
* Update README.md

Fixed the 'unpacked extension' link and revised wording for clarity

* Update README.md

Revised wording [2]

* Clarify README

Better wording on the first two sentences
2026-01-07 15:14:07 +00:00
Mike Wasserman
043d263fee Add Prompt API trial tokens for multimodal extension samples (#1597)
* Add Prompt API trial tokens for multimodal extension samples

* Add keys and update tokens

---------

Co-authored-by: Mike Wasserman <msw@chromium.org>
2026-01-06 13:51:57 +00:00
Vin Lim
5f6f02b924 Fix prompt format for image description in prompt array (#1516)
* Fix prompt format for image description in prompt array

* [Bug] Fix syntax error (#1515)

* Fix syntax error

* Fix prompt format for audio transcription in session.promptStreaming

* Fix formatting

---------

Co-authored-by: Sebastian Benz <sbenz@google.com>
2025-07-29 08:42:39 +02:00
Vin Lim
eca778c3c6 Fix/format issue (#1518)
* Fix prompt format for image description in prompt array

* Fix formatting for audio scribe example

* Revert unrelated commit
2025-07-29 08:40:22 +02:00
Vin Lim
62de17bf69 [Bug] Fix syntax error (#1515)
* Fix syntax error

* Fix prompt format for audio transcription in session.promptStreaming
2025-07-28 13:28:13 +02:00
Oliver Dunk
517cf1093e Move sw-tips tutorial to use chrome.dev (#1505)
Moves from the Glitch URL to chrome.dev, and removes the host
permissions as we now set CORS headers.
2025-07-10 15:31:51 +02:00
Oliver Dunk
b55612ae64 Handle SPA navigations in reading time example. (#1496)
In the move to new infrastructure for https://developer.chrome.com/, the
site became an SPA which can soft navigate outside of browser
navigations. Therefore, we need to update the sample to watch for
changes to content after the content script is injected.
2025-06-23 09:34:53 +02:00
dependabot[bot]
fb85450cc0 Bump dompurify in /functional-samples/ai.gemini-on-device (#1448)
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.1.6 to 3.2.4.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](https://github.com/cure53/DOMPurify/compare/3.1.6...3.2.4)

---
updated-dependencies:
- dependency-name: dompurify
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-10 15:30:01 +01:00
Chris Ho
9911b0a667 on installation open up the sidepanel for users (#1483)
* on installation open up the sidepanel for users

* ran 'npm run lint:fix'
2025-06-05 13:05:41 +01:00
Oliver Dunk
08e8c96c5f Add linter fixes for new AI samples (#1484) 2025-06-02 13:46:10 +02:00
Sebastian Benz
20d36c7780 Fixes to AI samples (#1479)
* Migrate to latest summarizer API

* fix temperature to be less creative
2025-05-23 17:29:23 +02:00
Sebastian Benz
a8aec773d8 add audio scribe sample (#1475)
* add audio scribe sample

* Fix wrong parameter name

* Cleanup and more robust audio scribe

* better manifest descriptions

* demo chat app clean up
2025-05-20 08:37:50 +02:00
Sebastian Benz
a42c4121cc Add new AI samples and update existing to use new API shape (#1474)
* Add new AI samples and update existing to use new API shape

* address comments
2025-05-16 20:43:25 +02:00
Zaif Senpai
0a67271feb Replaced clearbit API (deprecated) (#1453) (#1456)
* Replaced clearbit API (deprecated) with Google's favicon snatcher

* Updated UI designs for optional_permissions examples of both mv2 and mv3

Using chrome's build in favicon provider for optional_permissions examples

* Run linter

---------

Co-authored-by: Oliver Dunk <oliverdunk@google.com>
2025-05-08 13:59:07 +01:00
Oliver Dunk
5113e3c266 Use Puppeteer LaunchOptions for loading extensions. (#1466)
This is supported in the latest release: https://github.com/puppeteer/puppeteer/releases/tag/puppeteer-core-v24.8.0
2025-05-07 11:08:10 +01:00
Oliver Dunk
9b88cf7e14 Address feedback on mole game tutorial code. (#1462) 2025-04-30 17:14:43 +01:00
Oliver Dunk
aab4aa91fd Partial fixes for sample list generator (#1464)
* Partial fixes for sample list generator

A number of fixes for the sample list generator:

- Removes a comment from one of our manifest files, as we don't
  currently support JSONC.
- Ignores the `node_modules` folder since we have recently added some AI
  samples with a build step.
- Adds the `aiOriginTrial` API to the list of recognised APIs.
- Updates `extension-apis.json` with the latest data from the
  `chrome-types` package.

Updating recognised extension APIs still requires access to a
non-existent storage bucket, so this does not fully fix the process.

* Fix linter issue
2025-04-30 17:14:32 +01:00
Thomas Steiner
8fe3174642 Update to new API shape 2025-04-22 06:52:37 -07:00
Thomas Steiner
66672f857a Update to new API shape 2025-04-22 06:48:54 -07:00
ljjlee
b0f55f9d15 Disambiguate account/local folders sample bookmarks extension (#1435)
* Disambiguate account/local folders in the UI for sample bookmarks extension

* Code-review markups

* Fix lint issues
2025-04-03 11:05:22 +01:00
Oliver Dunk
6116518873 Add mole game tutorial (#1433)
LGTN
2025-04-02 18:10:45 +01:00
dependabot[bot]
8f97d22fdc Bump cross-spawn in /functional-samples/tutorial.terminate-sw/puppeteer (#1399)
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-31 21:14:15 +01:00
dependabot[bot]
f475b140a4 Bump cross-spawn in /functional-samples/tutorial.puppeteer (#1358)
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-31 16:50:41 +00:00
Rishi Kumar Tiwari
40e9576a29 Added README Files For Tutorials (#1371)
* tutorials redme

* update 404 URLs

* tutorials redme

* readme files

* readme

* readme

* Update functional-samples/tutorial.getting-started/README.md

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

* url change not required

* Update functional-samples/tutorial.tabs-manager/README.md

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

* Update README.md

* Update functional-samples/tutorial.tabs-manager/README.md

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

* Update functional-samples/tutorial.hello-world/README.md

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

* Update functional-samples/tutorial.getting-started/README.md

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

* Update functional-samples/tutorial.hello-world/README.md

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

* Update functional-samples/tutorial.getting-started/README.md

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

* Update functional-samples/tutorial.getting-started/README.md

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

* Update functional-samples/tutorial.getting-started/README.md

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

* foxed typo for tabGroups

* Fixed typo for tabGroups

---------

Co-authored-by: Oliver Dunk <oliver@oliverdunk.com>
2025-01-13 10:15:28 +00:00
Justin Lulejian
5064031481 Remove notification permission from push cookbook sample (#1365)
* Remove notification permission from push cookbook sample

As of [M132] this requirement is no longer necessary (unless the extension chooses to show a notification).

[M132]: https://chromiumdash.appspot.com/commit/ed68ac786e9a276ef2b627b7e21cf0d20cc6d798

* address review comments

* Add note about minimum Chrome version

---------

Co-authored-by: Oliver Dunk <oliverdunk@google.com>
2024-12-24 21:08:12 +00:00
Justin Lulejian
74bca08177 Run prettier on repository (#1366) 2024-12-03 10:50:45 +00:00
Oliver Dunk
74e1edfac3 Rename addSiteAccessRequest to addHostAccessRequest (#1356) 2024-11-26 14:29:59 +01:00
Oliver Dunk
6b4db6a6c0 Add permissions.addSiteAccessRequest() sample (#1322)
* Add permissions.addSiteAccessRequest() demo

Adds an example of using the permissions.addSiteAccessRequest() API to
request access to a checkout page. This matches the example used in our
upcoming blog post.

* Add banner to show that the extension has access.
2024-11-18 13:31:46 +00:00
Muhammad Mahad
4fb578eb1d Rename privacy,txt to privacy.txt (#1350) 2024-11-18 09:47:37 +00:00
Sebastian Benz
ba5b96aba0 inc manifest version (#1348) 2024-11-12 15:35:27 +01:00
Sebastian Benz
2f056ff117 Update Geminin nano samples (#1347)
* Link to latest articles
* Add systemprompt to prompt sample to provide better guidance on simple
  prompts such as 'hello'.
* Limit default topK to 3 (the default is currently set too high, this
  will change).
* Fix setup instructions in the readmes.
2024-11-12 14:02:43 +01:00
Sebastian Benz
fc7c4b34f1 Summarizer sample: Format markdown output (#1283)
* Format markdown output

* updates & fixes

* Styles and config

* Some CSS love with open props
* Make summary configurable

* Update functional-samples/ai.gemini-on-device-summarization/sidepanel/index.js

Shorter and worker-compatible

Co-authored-by: Thomas Steiner <tomac@google.com>

* Update functional-samples/ai.gemini-on-device-summarization/manifest.json

Co-authored-by: Thomas Steiner <tomac@google.com>

---------

Co-authored-by: Thomas Steiner <tomac@google.com>
2024-11-09 13:14:30 +01:00
Sebastian Benz
69f946b35e Improve prompt API sample (#1344)
* Improve prompt API sample

* Render response as markdown
* Fix initial maxK and temperature values
* Add privacy statement (for webstore submission)
* Regenerate key and trial token

* fix formatting errors

* Update functional-samples/ai.gemini-on-device/sidepanel/index.js

Update maxTemperature

Co-authored-by: Thomas Steiner <tomac@google.com>

* Update functional-samples/ai.gemini-on-device/sidepanel/index.js

Better string comparison

Co-authored-by: Thomas Steiner <tomac@google.com>

---------

Co-authored-by: Thomas Steiner <tomac@google.com>
2024-11-08 15:35:27 +01:00
patrick kettner
d2fd736ac0 Add an example that shows how to polyfill XHR in an extension (#1343)
* add an example that shows how to polyfill XHR in an extension

* updates from feedback

* update based on third party OSS requirements

* update readme links
2024-11-07 04:30:06 -05:00
Thomas Steiner
b939ca2db9 Change on-device example to use the origin trial API (#1337)
* Add scaffolding for Prompt API OT example

* Rewrite existing example to use the OT

* Add trial token and key

* Update error message, add `minimum_chrome_version`

* Fix feature detection

* Some README refinements

* Correct instructions

* OT refinement
2024-10-31 15:46:16 +01:00
Gitesh Mahadik
e5598ed5a5 Fix ai.assistant Session Creation Issue in ai.gemini-on-device (#1330)
* Updated: Session creation

* Updated: Session creation

* Updated: Session Creation
2024-10-23 22:24:32 +02:00
dependabot[bot]
51c16f6b7a Bump rollup in /functional-samples/ai.gemini-in-the-cloud (#1320)
Bumps [rollup](https://github.com/rollup/rollup) from 4.19.0 to 4.22.4.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v4.19.0...v4.22.4)

---
updated-dependencies:
- dependency-name: rollup
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 12:26:27 +01:00
dependabot[bot]
f2ab830c64 Bump rollup in /functional-samples/ai.gemini-on-device-summarization (#1292)
Bumps [rollup](https://github.com/rollup/rollup) from 4.18.1 to 4.22.4.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v4.18.1...v4.22.4)

---
updated-dependencies:
- dependency-name: rollup
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 12:21:57 +01:00
Sebastian Benz
8dcd06dc20 Update web accessible resource samples to use dynamic URLs (#1317) 2024-10-08 15:47:52 +02:00
dependabot[bot]
edf97795a6 Bump micromatch in /functional-samples/tutorial.terminate-sw/puppeteer (#1282)
Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.5 to 4.0.8.
- [Release notes](https://github.com/micromatch/micromatch/releases)
- [Changelog](https://github.com/micromatch/micromatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/micromatch/compare/4.0.5...4.0.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-17 10:35:58 +01:00
Sebastian Benz
18a4801660 Add on device summary sample (#1263)
* Add on device summary sample

* small tweaks and clean up

* more clean up

* Add link to blog post

* show correct error when ai is not supported in browser

* addressed comments

* fix path
2024-09-13 17:38:40 +02:00
dependabot[bot]
0a92c15491 Bump micromatch in /functional-samples/tutorial.puppeteer (#1281)
Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.5 to 4.0.8.
- [Release notes](https://github.com/micromatch/micromatch/releases)
- [Changelog](https://github.com/micromatch/micromatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/micromatch/compare/4.0.5...4.0.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-11 10:17:36 +01:00
Paige Bailey
29f9fa0d71 Update README.md to clarify that this example isn't using Gemini Nano (on-device), it's using the Gemini APIs from AI Studio. (#1277) 2024-09-11 10:10:55 +01:00
Sebastian Benz
cbfd8823fa Migrate to new prompt API (#1264)
...also add a check whether the browser supports the prompt API.
2024-08-28 12:14:45 +02:00