Skip to content

Add Gmail compose domain skill#428

Open
guglielmofonda wants to merge 1 commit into
browser-use:mainfrom
guglielmofonda:gmail-compose-skill
Open

Add Gmail compose domain skill#428
guglielmofonda wants to merge 1 commit into
browser-use:mainfrom
guglielmofonda:gmail-compose-skill

Conversation

@guglielmofonda

@guglielmofonda guglielmofonda commented Jun 11, 2026

Copy link
Copy Markdown

Adds domain-skills/gmail/compose.md covering field-tested compose mechanics:

  • /mail/u/<email>/ account routing for multi-account sessions (+ transient "Temporary Error" on first load)
  • Stable selectors: [gh="cm"] compose button, To/Subject/Body fields
  • Minimized-compose state detection (offsetParent null) and restore
  • Trap: Gmail's require-trusted-types-for CSP blocks insertHTML/innerHTML — documented the trustedTypes.createPolicy bypass (policy names are unrestricted) plus the InputEvent dispatch required for autosave to register the change
  • Draft save/close/verify patterns

🤖 Generated with Claude Code


Summary by cubic

Adds a new Gmail compose domain skill documenting a stable, end-to-end flow for opening, filling, and saving drafts, including a Trusted Types-safe HTML insert. This reduces flakiness by using robust selectors and covers autosave nuances.

  • New Features
    • Multi-account routing via /mail/u// with note on transient “Temporary Error” on first load.
    • Stable selectors for Compose button and To/Subject/Body fields.
    • Detection and restore of minimized compose windows before filling.
    • Trusted Types CSP workaround using trustedTypes.createPolicy and InputEvent dispatch so autosave registers content.
    • Draft save/close patterns and verification via list row snippets.

Written for commit 575b711. Summary will update on new commits.

Review in cubic

…, draft autosave

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@browser-harness-review

Copy link
Copy Markdown

✅ Skill review passed

Reviewed 1 file(s) — no findings.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 575b711491

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


## Account routing

Multi-account sessions: `https://mail.google.com/mail/u/<email>/` routes to that signed-in account directly — no clicking through the account switcher. Works with `#drafts`, `#sent`, etc. appended. First load sometimes lands on a "Temporary Error" page title that resolves itself; wait a beat and re-check `page_info()` before assuming failure.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Put Gmail skill where goto_url can discover it

When agents follow this documented Gmail URL, goto_url() will not surface the new skill: helpers.py:52 maps a hostname to domain-skills/<first-label> after stripping only www, so https://mail.google.com/... looks under domain-skills/mail, not domain-skills/gmail. In the normal navigation flow the returned domain_skills hint is therefore missing for Gmail, so this compose guidance is easy to miss unless the agent manually searches the repo; move it to the directory the loader uses or update the loader to alias mail.google.com to gmail.

Useful? React with 👍 / 👎.


```js
const p = window.trustedTypes.createPolicy('fill-' + Math.floor(Math.random()*1e6), {createHTML: s => s});
const b = document.querySelector("div[aria-label='Message Body']");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Scope body lookup to the active compose window

If Gmail already has another compose or reply editor open, this querySelector grabs the first message body in the document rather than the compose window opened for the current draft. Gmail supports multiple compose windows/minimized drafts, so following this snippet can overwrite and autosave the wrong draft; scope the lookup to the visible compose dialog/container you just opened before assigning innerHTML.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant