GoogleChrome / GoogleChrome/chrome-extensions-samples

Modernizing the sandbox sample: Handlebars update and messaging hardening

Open
#1,615 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
17.8k
Forks
9k
Avg merge
21h
Merged PRs (30d)
28

Description

Refining the sandbox sample to reflect modern standards would be beneficial for developers learning from this repo. Noticed that the `api-samples/sandbox` directory still relies on Handlebars 1.0.0-beta.6, which dates back to 2012. Using such an ancient version in a current sample might lead developers to inadvertently include insecure or unmaintained dependencies in their own extensions.

Tightening the communication logic by replacing `postMessage("*")` with an explicit origin check would also set a better security precedent. Even though the sandbox environment provides isolation, showcasing a restricted origin check helps prevent developers from copy-pasting wildcard patterns into non-sandboxed contexts.

Would you be open to a PR that updates the library to a stable version and implements more restrictive messaging? Just wanted to check if this is something you'd like to see updated to keep the samples aligned with current best practices.

Contributor guide

Open the contributing guide

Research direction

Start in the api-samples/sandbox directory by inspecting its Handlebars dependency and locating the postMessage("*") usage. Confirm a stable Handlebars version and an explicit origin that fit the sample, then verify the sandbox still works with the restricted messaging behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
handlebars, javascript
Domain
security, web-dev
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.