From facee6120b72b830ea21522cb17c9c575805ef0e Mon Sep 17 00:00:00 2001 From: Minsu Lee <1964421+amondnet@users.noreply.github.com> Date: Fri, 30 Oct 2026 15:46:30 +0900 Subject: [PATCH] fix(modern-web-guidance): vendor plugin into the marketplace Install the modern-web-guidance and chrome-extensions skills from GoogleChrome/modern-web-guidance@4f2b13e via skills.sh into plugins/modern-web-guidance and switch the marketplace source to the local path, so installing the plugin (or frontend@passionfactory, which depends on it) no longer clones the upstream repo. The skills-lock.json puts it under the weekly update-skills.yml refresh. The upstream Apache-2.0 LICENSE is kept; upstream ships no NOTICE file. The version continues upstream's 0.0.196 so existing installs never see a lower version. --- .agents/plugins/marketplace.json | 4 +- .claude-plugin/marketplace.json | 5 +- .cursor-plugin/marketplace.json | 5 + .release-please-manifest.json | 1 + README.md | 6 + .../.agents/skills/chrome-extensions/SKILL.md | 530 ++++++++++++++ .../references/extensions/api-calling.md | 72 ++ .../references/extensions/auth-identity.md | 141 ++++ .../references/extensions/content-scripts.md | 112 +++ .../references/extensions/context-menus.md | 72 ++ .../references/extensions/csp-sandbox.md | 177 +++++ .../extensions/declarative-net-request.md | 112 +++ .../references/extensions/devtools.md | 102 +++ .../references/extensions/icons.md | 101 +++ .../references/extensions/media-capture.md | 140 ++++ .../references/extensions/message-passing.md | 136 ++++ .../references/extensions/omnibox.md | 83 +++ .../references/extensions/permissions.md | 113 +++ .../references/extensions/popup-ui.md | 94 +++ .../references/extensions/prompt-api.md | 117 +++ .../references/extensions/service-worker.md | 148 ++++ .../references/extensions/side-panel.md | 147 ++++ .../references/extensions/storage.md | 65 ++ .../references/extensions/tab-management.md | 132 ++++ .../references/extensions/user-scripts.md | 273 +++++++ .../webstore/chromewebstore-template.md | 178 +++++ .../references/webstore/privacy-policy.md | 128 ++++ .../references/webstore/review-checklist.md | 145 ++++ .../references/webstore/store-listing.md | 201 +++++ .../skills/modern-web-guidance/SKILL.md | 136 ++++ .../guides/accessibility/accessibility.md | 585 +++++++++++++++ .../accessible-error-announcement.md | 208 ++++++ .../accessible-generated-content.md | 23 + .../accessibility/respect-os-text-scale.md | 127 ++++ .../guides/built-in-ai/language-detection.md | 91 +++ .../guides/built-in-ai/language-model.md | 368 ++++++++++ .../guides/built-in-ai/prompt-api.md | 368 ++++++++++ .../guides/built-in-ai/summarizer.md | 156 ++++ .../guides/built-in-ai/translator.md | 189 +++++ .../guides/css/animate-to-intrinsic-sizes.md | 128 ++++ .../guides/css/atrule-support-conditionals.md | 148 ++++ .../css/calculate-with-intrinsic-sizes.md | 199 +++++ .../guides/css/child-state-based-styling.md | 103 +++ .../guides/css/content-based-styling.md | 120 +++ .../guides/css/css-layout.md | 317 ++++++++ .../modern-web-guidance/guides/css/css.md | 250 +++++++ .../guides/css/design-token-reactivity.md | 176 +++++ .../guides/css/dynamic-sibling-styling.md | 97 +++ .../guides/css/fluid-scaling.md | 80 ++ .../css/individual-transform-properties.md | 94 +++ .../guides/css/overflow-clipping-control.md | 181 +++++ .../guides/css/reduce-style-repetition.md | 87 +++ .../guides/css/responsive-design.md | 16 + .../css/selector-atrule-combinations.md | 150 ++++ .../guides/css/size-aware-styling.md | 106 +++ .../guides/css/style-parent-with-has.md | 200 +++++ .../css/usage-aware-component-variations.md | 108 +++ .../guides/forms/animated-select-picker.md | 179 +++++ .../guides/forms/autofill-address-form.md | 82 +++ .../guides/forms/autofill-highlight-inputs.md | 45 ++ .../guides/forms/autofill-payment-form.md | 138 ++++ .../guides/forms/autofill-sign-in-form.md | 141 ++++ .../guides/forms/autofill-sign-up-form.md | 151 ++++ .../guides/forms/brand-consistent-forms.md | 255 +++++++ .../guides/forms/branded-select-styling.md | 115 +++ .../forms/custom-select-picker-layouts.md | 166 +++++ .../form-fields-automatically-fit-contents.md | 122 ++++ .../modern-web-guidance/guides/forms/forms.md | 380 ++++++++++ .../guides/forms/ime-safe-enter-submit.md | 115 +++ .../guides/forms/required-field-feedback.md | 214 ++++++ .../guides/forms/rich-media-picker.md | 133 ++++ .../guides/forms/select-menu-interaction.md | 178 +++++ .../guides/forms/slider.md | 182 +++++ .../guides/forms/sms-otp-form.md | 208 ++++++ .../guides/forms/switch.md | 60 ++ .../forms/validate-input-after-interaction.md | 258 +++++++ .../guides/html/accessible-web-components.md | 61 ++ .../guides/html/custom-elements.md | 122 ++++ .../html/form-associated-custom-elements.md | 73 ++ .../modern-web-guidance/guides/html/html.md | 409 +++++++++++ .../html/prerendering-custom-elements.md | 64 ++ .../guides/html/shadow-dom.md | 79 ++ .../guides/html/styling-web-components.md | 130 ++++ .../guides/html/web-components.md | 50 ++ .../js/calculate-event-differentials.md | 117 +++ .../js/capture-location-agnostic-data.md | 149 ++++ .../guides/js/coordinate-global-events.md | 80 ++ .../js/sort-high-precision-timestamps.md | 92 +++ .../js/support-global-calendar-systems.md | 103 +++ .../performance/batch-analytics-events.md | 154 ++++ .../guides/performance/break-up-long-tasks.md | 62 ++ .../calculate-total-foreground-time.md | 69 ++ .../conditional-async-dependencies.md | 74 ++ .../defer-rendering-heavy-content.md | 106 +++ .../defer-work-until-scroll-ends.md | 78 ++ .../deliver-optimized-decorative-images.md | 51 ++ .../deprioritize-background-fetches.md | 37 + .../detect-initial-visibility-state.md | 101 +++ .../efficient-background-processing.md | 117 +++ .../faster-spa-view-transitions.md | 79 ++ .../flicker-free-client-side-ab-testing.md | 168 +++++ .../performance/full-session-analytics.md | 135 ++++ .../performance/identify-heavy-scripts.md | 69 ++ .../guides/performance/identify-inp-causes.md | 105 +++ .../improve-next-page-load-performance.md | 121 +++ .../performance/interaction-paint-timing.md | 200 +++++ .../interactions-in-complex-layouts.md | 78 ++ .../performance/lazy-load-video-and-audio.md | 192 +++++ .../performance/optimize-image-priority.md | 73 ++ .../performance/optimize-preload-priority.md | 41 ++ .../performance/optimize-script-priority.md | 38 + .../out-of-order-html-streaming.md | 144 ++++ .../guides/performance/performance.md | 384 ++++++++++ .../resolution-optimized-pseudo-elements.md | 49 ++ .../performance/schedule-tasks-by-priority.md | 61 ++ .../guides/privacy/privacy.md | 247 +++++++ .../guides/pwa/migrate-web-app-origin.md | 98 +++ .../guides/security/client-side-encryption.md | 302 ++++++++ .../guides/security/digital-signatures.md | 235 ++++++ .../guides/security/local-network-access.md | 192 +++++ .../guides/security/passkey-authentication.md | 205 ++++++ .../security/passkey-conditional-create.md | 134 ++++ .../guides/security/passkey-management.md | 235 ++++++ .../security/passkey-reauthentication.md | 128 ++++ .../guides/security/passkey-registration.md | 181 +++++ .../guides/security/passkeys.md | 39 + .../guides/security/quick-sign-ins.md | 242 ++++++ .../security/restrict-outbound-connections.md | 169 +++++ .../security/sanitize-untrusted-html.md | 105 +++ .../security/secure-external-subresources.md | 202 +++++ .../guides/security/security.md | 380 ++++++++++ .../guides/security/trusted-types.md | 140 ++++ .../guides/security/validate-origins.md | 197 +++++ .../guides/security/verify-email-ownership.md | 235 ++++++ .../guides/ui-atoms/carousel-slide-effects.md | 187 +++++ .../component-specific-light-dark-theme.md | 179 +++++ .../guides/ui-atoms/icons.md | 290 ++++++++ .../ui-atoms/position-aware-tooltips.md | 158 ++++ .../guides/ui-atoms/pull-to-reveal.md | 83 +++ .../guides/ui-atoms/responsive-table.md | 121 +++ .../scroll-position-aware-elements.md | 130 ++++ .../ui-atoms/scroll-progress-indicator.md | 133 ++++ .../scrollability-affordance-hints.md | 126 ++++ .../ui-atoms/shrinking-header-on-scroll.md | 126 ++++ .../ui-atoms/state-aware-sticky-headers.md | 139 ++++ .../ui-atoms/viewport-aware-dropdowns.md | 134 ++++ .../guides/ui-behaviors/2d-panning.md | 151 ++++ .../anchor-positioning-tab-underline.md | 99 +++ .../animate-element-entry-exit.md | 192 +++++ .../ui-behaviors/animate-to-from-top-layer.md | 240 ++++++ .../ui-behaviors/carousel-snap-highlights.md | 138 ++++ .../consistent-cross-document-transitions.md | 259 +++++++ .../cross-document-transitions.md | 129 ++++ .../ui-behaviors/custom-button-actions.md | 180 +++++ .../declarative-dialog-popover-control.md | 232 ++++++ .../directional-navigation-transitions.md | 128 ++++ .../guides/ui-behaviors/drag.md | 84 +++ .../dynamic-sibling-animations.md | 53 ++ .../ui-behaviors/group-element-transitions.md | 126 ++++ .../ui-behaviors/highlight-text-ranges.md | 130 ++++ .../interactive-content-reveal.md | 120 +++ .../interest-triggered-action-previews.md | 93 +++ .../interest-triggered-tooltips.md | 179 +++++ .../ui-behaviors/light-dismiss-a-dialog.md | 86 +++ .../guides/ui-behaviors/motion.md | 102 +++ .../move-dom-element-without-losing-state.md | 59 ++ .../ui-behaviors/parallax-scroll-effects.md | 230 ++++++ .../ui-behaviors/persistent-top-layer-ui.md | 50 ++ .../ui-behaviors/physics-based-easing.md | 120 +++ .../platform-controls-dismiss-dialog.md | 40 + .../prevent-page-scroll-under-modal-dialog.md | 59 ++ .../ui-behaviors/same-document-transitions.md | 177 +++++ .../scoped-component-transitions.md | 229 ++++++ .../ui-behaviors/scroll-completion-effects.md | 97 +++ .../ui-behaviors/scroll-entry-exit-effects.md | 173 +++++ .../scroll-snap-realtime-feedback.md | 156 ++++ .../ui-behaviors/scroll-snap-state-sync.md | 95 +++ .../ui-behaviors/scroll-target-on-load.md | 56 ++ .../guides/ui-behaviors/scrollytelling.md | 181 +++++ .../ui-behaviors/search-hidden-content.md | 141 ++++ .../guides/ui-behaviors/spatial-navigation.md | 56 ++ .../guides/ui-behaviors/swipe-to-remove.md | 544 ++++++++++++++ .../guides/ui-behaviors/swipe-to-reveal.md | 164 +++++ .../guides/ui-components/card.md | 132 ++++ .../guides/ui-components/checkbox.md | 142 ++++ .../guides/ui-components/dark-mode-toggle.md | 138 ++++ .../guides/ui-components/dialog.md | 226 ++++++ .../guides/ui-components/hovercard.md | 279 +++++++ .../guides/ui-components/menu.md | 410 +++++++++++ .../guides/ui-components/navigation-drawer.md | 365 ++++++++++ .../ui-components/persistent-app-tours.md | 137 ++++ .../persistent-toast-notifications.md | 64 ++ .../guides/ui-components/progress-ring.md | 181 +++++ .../guides/ui-components/progress.md | 181 +++++ .../guides/ui-components/scrollspy.md | 127 ++++ .../guides/ui-components/spinner.md | 169 +++++ .../guides/ui-components/stack-drill-down.md | 689 ++++++++++++++++++ ...adapt-scrollbar-to-contrast-preferences.md | 74 ++ .../visual-design/apply-webgl-shaders.md | 278 +++++++ .../visual-design/browser-ui-theming.md | 39 + .../guides/visual-design/color.md | 43 ++ .../guides/visual-design/complex-shapes.md | 75 ++ .../guides/visual-design/contrast-color.md | 187 +++++ .../visual-design/custom-text-decorations.md | 337 +++++++++ ...customize-scrollbar-color-and-thickness.md | 59 ++ .../guides/visual-design/dark-mode.md | 339 +++++++++ .../visual-design/equal-width-text-lines.md | 97 +++ .../export-html-media-from-canvas.md | 327 +++++++++ ...pose-canvas-content-to-browser-features.md | 433 +++++++++++ .../improve-text-layout-and-legibility.md | 77 ++ .../interactive-content-in-3d-scenes.md | 448 ++++++++++++ .../visual-design/precise-text-alignment.md | 99 +++ .../guides/visual-design/shaped-cutouts.md | 148 ++++ .../visual-design/soft-edge-content-fade.md | 64 ++ .../guides/visual-design/typography.md | 38 + .../guides/visual-design/visual-effects.md | 100 +++ .../visually-stable-font-fallbacks.md | 51 ++ .../visually-stable-mixed-fonts.md | 63 ++ .../visual-design/visually-texture-content.md | 78 ++ .../guides/wasm/cpp-on-the-web.md | 74 ++ .../guides/webmcp/agentic-forms.md | 127 ++++ .../guides/webmcp/agentic-javascript-tools.md | 423 +++++++++++ .../guides/webmcp/webmcp.md | 45 ++ .../.claude-plugin/plugin.json | 20 + .../.codex-plugin/plugin.json | 33 + .../.cursor-plugin/plugin.json | 25 + plugins/modern-web-guidance/LICENSE | 202 +++++ plugins/modern-web-guidance/plugin.json | 20 + plugins/modern-web-guidance/skills-lock.json | 17 + release-please-config.json | 26 + 230 files changed, 34308 insertions(+), 6 deletions(-) create mode 100644 plugins/modern-web-guidance/.agents/skills/chrome-extensions/SKILL.md create mode 100644 plugins/modern-web-guidance/.agents/skills/chrome-extensions/references/extensions/api-calling.md create mode 100644 plugins/modern-web-guidance/.agents/skills/chrome-extensions/references/extensions/auth-identity.md create mode 100644 plugins/modern-web-guidance/.agents/skills/chrome-extensions/references/extensions/content-scripts.md create mode 100644 plugins/modern-web-guidance/.agents/skills/chrome-extensions/references/extensions/context-menus.md create mode 100644 plugins/modern-web-guidance/.agents/skills/chrome-extensions/references/extensions/csp-sandbox.md create mode 100644 plugins/modern-web-guidance/.agents/skills/chrome-extensions/references/extensions/declarative-net-request.md create mode 100644 plugins/modern-web-guidance/.agents/skills/chrome-extensions/references/extensions/devtools.md create mode 100644 plugins/modern-web-guidance/.agents/skills/chrome-extensions/references/extensions/icons.md create mode 100644 plugins/modern-web-guidance/.agents/skills/chrome-extensions/references/extensions/media-capture.md create mode 100644 plugins/modern-web-guidance/.agents/skills/chrome-extensions/references/extensions/message-passing.md create mode 100644 plugins/modern-web-guidance/.agents/skills/chrome-extensions/references/extensions/omnibox.md create mode 100644 plugins/modern-web-guidance/.agents/skills/chrome-extensions/references/extensions/permissions.md create mode 100644 plugins/modern-web-guidance/.agents/skills/chrome-extensions/references/extensions/popup-ui.md create mode 100644 plugins/modern-web-guidance/.agents/skills/chrome-extensions/references/extensions/prompt-api.md create mode 100644 plugins/modern-web-guidance/.agents/skills/chrome-extensions/references/extensions/service-worker.md create mode 100644 plugins/modern-web-guidance/.agents/skills/chrome-extensions/references/extensions/side-panel.md create mode 100644 plugins/modern-web-guidance/.agents/skills/chrome-extensions/references/extensions/storage.md create mode 100644 plugins/modern-web-guidance/.agents/skills/chrome-extensions/references/extensions/tab-management.md create mode 100644 plugins/modern-web-guidance/.agents/skills/chrome-extensions/references/extensions/user-scripts.md create mode 100644 plugins/modern-web-guidance/.agents/skills/chrome-extensions/references/webstore/chromewebstore-template.md create mode 100644 plugins/modern-web-guidance/.agents/skills/chrome-extensions/references/webstore/privacy-policy.md create mode 100644 plugins/modern-web-guidance/.agents/skills/chrome-extensions/references/webstore/review-checklist.md create mode 100644 plugins/modern-web-guidance/.agents/skills/chrome-extensions/references/webstore/store-listing.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/SKILL.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/accessibility/accessibility.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/accessibility/accessible-error-announcement.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/accessibility/accessible-generated-content.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/accessibility/respect-os-text-scale.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/built-in-ai/language-detection.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/built-in-ai/language-model.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/built-in-ai/prompt-api.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/built-in-ai/summarizer.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/built-in-ai/translator.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/css/animate-to-intrinsic-sizes.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/css/atrule-support-conditionals.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/css/calculate-with-intrinsic-sizes.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/css/child-state-based-styling.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/css/content-based-styling.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/css/css-layout.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/css/css.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/css/design-token-reactivity.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/css/dynamic-sibling-styling.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/css/fluid-scaling.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/css/individual-transform-properties.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/css/overflow-clipping-control.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/css/reduce-style-repetition.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/css/responsive-design.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/css/selector-atrule-combinations.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/css/size-aware-styling.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/css/style-parent-with-has.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/css/usage-aware-component-variations.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/forms/animated-select-picker.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/forms/autofill-address-form.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/forms/autofill-highlight-inputs.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/forms/autofill-payment-form.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/forms/autofill-sign-in-form.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/forms/autofill-sign-up-form.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/forms/brand-consistent-forms.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/forms/branded-select-styling.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/forms/custom-select-picker-layouts.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/forms/form-fields-automatically-fit-contents.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/forms/forms.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/forms/ime-safe-enter-submit.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/forms/required-field-feedback.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/forms/rich-media-picker.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/forms/select-menu-interaction.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/forms/slider.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/forms/sms-otp-form.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/forms/switch.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/forms/validate-input-after-interaction.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/html/accessible-web-components.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/html/custom-elements.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/html/form-associated-custom-elements.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/html/html.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/html/prerendering-custom-elements.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/html/shadow-dom.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/html/styling-web-components.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/html/web-components.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/js/calculate-event-differentials.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/js/capture-location-agnostic-data.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/js/coordinate-global-events.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/js/sort-high-precision-timestamps.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/js/support-global-calendar-systems.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/batch-analytics-events.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/break-up-long-tasks.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/calculate-total-foreground-time.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/conditional-async-dependencies.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/defer-rendering-heavy-content.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/defer-work-until-scroll-ends.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/deliver-optimized-decorative-images.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/deprioritize-background-fetches.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/detect-initial-visibility-state.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/efficient-background-processing.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/faster-spa-view-transitions.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/flicker-free-client-side-ab-testing.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/full-session-analytics.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/identify-heavy-scripts.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/identify-inp-causes.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/improve-next-page-load-performance.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/interaction-paint-timing.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/interactions-in-complex-layouts.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/lazy-load-video-and-audio.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/optimize-image-priority.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/optimize-preload-priority.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/optimize-script-priority.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/out-of-order-html-streaming.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/performance.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/resolution-optimized-pseudo-elements.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/performance/schedule-tasks-by-priority.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/privacy/privacy.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/pwa/migrate-web-app-origin.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/security/client-side-encryption.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/security/digital-signatures.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/security/local-network-access.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/security/passkey-authentication.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/security/passkey-conditional-create.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/security/passkey-management.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/security/passkey-reauthentication.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/security/passkey-registration.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/security/passkeys.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/security/quick-sign-ins.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/security/restrict-outbound-connections.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/security/sanitize-untrusted-html.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/security/secure-external-subresources.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/security/security.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/security/trusted-types.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/security/validate-origins.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/security/verify-email-ownership.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-atoms/carousel-slide-effects.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-atoms/component-specific-light-dark-theme.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-atoms/icons.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-atoms/position-aware-tooltips.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-atoms/pull-to-reveal.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-atoms/responsive-table.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-atoms/scroll-position-aware-elements.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-atoms/scroll-progress-indicator.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-atoms/scrollability-affordance-hints.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-atoms/shrinking-header-on-scroll.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-atoms/state-aware-sticky-headers.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-atoms/viewport-aware-dropdowns.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/2d-panning.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/anchor-positioning-tab-underline.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/animate-element-entry-exit.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/animate-to-from-top-layer.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/carousel-snap-highlights.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/consistent-cross-document-transitions.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/cross-document-transitions.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/custom-button-actions.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/declarative-dialog-popover-control.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/directional-navigation-transitions.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/drag.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/dynamic-sibling-animations.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/group-element-transitions.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/highlight-text-ranges.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/interactive-content-reveal.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/interest-triggered-action-previews.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/interest-triggered-tooltips.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/light-dismiss-a-dialog.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/motion.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/move-dom-element-without-losing-state.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/parallax-scroll-effects.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/persistent-top-layer-ui.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/physics-based-easing.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/platform-controls-dismiss-dialog.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/prevent-page-scroll-under-modal-dialog.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/same-document-transitions.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/scoped-component-transitions.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/scroll-completion-effects.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/scroll-entry-exit-effects.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/scroll-snap-realtime-feedback.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/scroll-snap-state-sync.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/scroll-target-on-load.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/scrollytelling.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/search-hidden-content.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/spatial-navigation.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/swipe-to-remove.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-behaviors/swipe-to-reveal.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-components/card.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-components/checkbox.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-components/dark-mode-toggle.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-components/dialog.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-components/hovercard.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-components/menu.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-components/navigation-drawer.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-components/persistent-app-tours.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-components/persistent-toast-notifications.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-components/progress-ring.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-components/progress.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-components/scrollspy.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-components/spinner.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/ui-components/stack-drill-down.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/visual-design/adapt-scrollbar-to-contrast-preferences.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/visual-design/apply-webgl-shaders.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/visual-design/browser-ui-theming.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/visual-design/color.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/visual-design/complex-shapes.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/visual-design/contrast-color.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/visual-design/custom-text-decorations.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/visual-design/customize-scrollbar-color-and-thickness.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/visual-design/dark-mode.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/visual-design/equal-width-text-lines.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/visual-design/export-html-media-from-canvas.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/visual-design/expose-canvas-content-to-browser-features.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/visual-design/improve-text-layout-and-legibility.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/visual-design/interactive-content-in-3d-scenes.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/visual-design/precise-text-alignment.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/visual-design/shaped-cutouts.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/visual-design/soft-edge-content-fade.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/visual-design/typography.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/visual-design/visual-effects.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/visual-design/visually-stable-font-fallbacks.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/visual-design/visually-stable-mixed-fonts.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/visual-design/visually-texture-content.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/wasm/cpp-on-the-web.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/webmcp/agentic-forms.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/webmcp/agentic-javascript-tools.md create mode 100644 plugins/modern-web-guidance/.agents/skills/modern-web-guidance/guides/webmcp/webmcp.md create mode 100644 plugins/modern-web-guidance/.claude-plugin/plugin.json create mode 100644 plugins/modern-web-guidance/.codex-plugin/plugin.json create mode 100644 plugins/modern-web-guidance/.cursor-plugin/plugin.json create mode 100644 plugins/modern-web-guidance/LICENSE create mode 100644 plugins/modern-web-guidance/plugin.json create mode 100644 plugins/modern-web-guidance/skills-lock.json diff --git a/.agents/plugins/marketplace.json b/.agents/plugins/marketplace.json index 79f7c3ec..e584b0b1 100644 --- a/.agents/plugins/marketplace.json +++ b/.agents/plugins/marketplace.json @@ -983,8 +983,8 @@ { "name": "modern-web-guidance", "source": { - "source": "url", - "url": "https://github.com/GoogleChrome/modern-web-guidance.git" + "source": "local", + "path": "./plugins/modern-web-guidance" }, "policy": { "installation": "AVAILABLE", diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 4cc58d51..b7f1c670 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -1369,10 +1369,7 @@ "category": "development", "keywords": ["web", "best-practices", "chrome", "baseline", "css", "performance"], "tags": ["skill", "web"], - "source": { - "source": "github", - "repo": "GoogleChrome/modern-web-guidance" - }, + "source": "./plugins/modern-web-guidance", "homepage": "https://github.com/GoogleChrome/modern-web-guidance" }, { diff --git a/.cursor-plugin/marketplace.json b/.cursor-plugin/marketplace.json index e4ef0ac8..a6a0239f 100644 --- a/.cursor-plugin/marketplace.json +++ b/.cursor-plugin/marketplace.json @@ -324,6 +324,11 @@ "source": "./plugins/genkit", "description": "Official Genkit skills - build AI-powered applications with Genkit in JavaScript/TypeScript, Go, Dart/Flutter, and Python: flows, generation, prompts, tool calling, agents, and model providers" }, + { + "name": "modern-web-guidance", + "source": "./plugins/modern-web-guidance", + "description": "Keep your coding agent up to date with the latest web best practices from the Google Chrome team" + }, { "name": "java-development", "source": "./plugins/java-development", diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ba8b9e65..d1e0441a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -20,6 +20,7 @@ "plugins/vue": "1.3.3", "plugins/vueuse": "1.3.2", "plugins/web-design": "1.4.3", + "plugins/modern-web-guidance": "0.0.196", "plugins/mastra": "1.7.4", "plugins/nuxt-ui": "1.6.5", "plugins/firebase": "1.1.3", diff --git a/README.md b/README.md index d23cf32c..ccd2cb4e 100644 --- a/README.md +++ b/README.md @@ -492,6 +492,12 @@ End-to-end typesafe APIs with oRPC v2 — the core `os` builder, routers, middle **Install:** `/plugin install orpc@pleaseai` | **Source:** [plugins/orpc](https://github.com/pleaseai/claude-code-plugins/tree/main/plugins/orpc) +#### Modern Web Guidance + +Keep your coding agent up to date with the latest web best practices from the Google Chrome team — modern HTML/CSS/JS patterns (`modern-web-guidance`) and Manifest V3 Chrome extensions (`chrome-extensions`). Vendored from [GoogleChrome/modern-web-guidance](https://github.com/GoogleChrome/modern-web-guidance) (Apache-2.0) and refreshed weekly by `update-skills.yml`. + +**Install:** `/plugin install modern-web-guidance@pleaseai` | **Source:** [plugins/modern-web-guidance](https://github.com/pleaseai/claude-code-plugins/tree/main/plugins/modern-web-guidance) + #### evlog Wide-event logging for TypeScript with [evlog](https://www.evlog.dev): review logging patterns and guide evlog adoption (`review-logging-patterns`), design tamper-aware audit trails (`build-audit-logs`), and debug from `.evlog/logs/` output (`analyze-logs`). Bundles the read-only evlog docs MCP server (`https://www.evlog.dev/mcp`) for current docs pages and log-cost estimates. diff --git a/plugins/modern-web-guidance/.agents/skills/chrome-extensions/SKILL.md b/plugins/modern-web-guidance/.agents/skills/chrome-extensions/SKILL.md new file mode 100644 index 00000000..91a915cd --- /dev/null +++ b/plugins/modern-web-guidance/.agents/skills/chrome-extensions/SKILL.md @@ -0,0 +1,530 @@ +--- +name: chrome-extensions +description: > + Build and publish Chrome Extensions using Manifest V3 best practices. Use this skill + whenever the user asks to create, modify, debug, or understand Chrome browser extensions, + add-ons, or anything involving the Chrome Extensions API. Trigger on mentions of: 'Chrome + extension', 'browser extension', 'manifest.json', 'content script', 'service worker' (in + browser context), 'popup' (in browser extension context), 'side panel', 'chrome.* API', + 'declarativeNetRequest', 'omnibox', 'context menu' (in extension context), 'userScripts', + 'user script', 'script manager', or any request to build functionality that integrates with + the Chrome browser UI. Also trigger for publishing to the Chrome Web Store: 'publish + extension', preparing an extension for publishing, responding to a review rejection, writing + permission justifications, or drafting a privacy policy. +--- + +# Chrome Extensions + +Build production-quality Chrome extensions using Manifest V3 and publish them to the Chrome Web Store. + +## Part 1 — Building Extensions + +### Mandatory Rules + +These address the most common causes of broken extensions. Violating any produces a non-functional build. + +#### 1. Icons: only reference files you create — or omit icons entirely + +``` +❌ BROKEN — referencing files that don't exist or reusing one file for all sizes: + "icons": { "16": "icon.png", "48": "icon.png", "128": "icon.png" } + +✅ CORRECT — each size is a separate file at the correct pixel dimensions: + "icons": { "16": "icons/icon-16.png", "48": "icons/icon-48.png", "128": "icons/icon-128.png" } + (where icon-16.png is 16×16px, icon-48.png is 48×48px, icon-128.png is 128×128px) + +✅ ALSO CORRECT — omit icons from manifest if you cannot generate real PNG files: + (just remove the "icons" and "default_icon" fields — Chrome uses a default icon) +``` + +**If you include icon references, you MUST create the actual image files.** Generate them with a script (see `references/extensions/icons.md`) or leave them out. Never reference non-existent files. + +#### 2. Side panel: you MUST provide a way to open it + +Defining `"side_panel": {"default_path": "..."}` does NOT make it openable. Add a trigger: + +```js +// In service-worker.js — open side panel on extension icon click +// IMPORTANT: chrome.action.onClicked ONLY fires when there is NO default_popup +chrome.action.onClicked.addListener(async (tab) => { + await chrome.sidePanel.open({ windowId: tab.windowId }); +}); +``` + +If the extension has both a popup AND side panel, add a button in the popup that calls `chrome.sidePanel.open()`. Alternatively, use `chrome.sidePanel.setPanelBehavior({ openPanelOnActionClick: true })` — but the property is `openPanelOnActionClick`, NOT `openPanelOnActionIconClick`; the "Icon" variant causes a synchronous TypeError that silently aborts the service worker. Do NOT also define `default_popup` when using `setPanelBehavior`. See `references/extensions/side-panel.md`. + +#### 3. Code execution: sandboxed iframes ONLY + +Extension CSP blocks `eval()`, `new Function()`, inline ` + + + + + + +``` + +In `popup.js`: +```js +document.getElementById('btn').addEventListener('click', () => { + // Handle click +}); +``` + +## Executing User Code (Code Playground Pattern) + +If you need to execute arbitrary code (e.g., a CodePen-like playground), you MUST use one of these +approaches. **Extension CSP completely blocks `eval()`, `new Function()`, and inline scripts in +normal extension pages.** There is no way around this — you need sandboxing. + +### Option 1: Sandboxed Page in Manifest (Recommended) + +Declare a sandboxed page in manifest.json. Sandboxed pages have a relaxed CSP that allows +`eval()` and inline scripts, but they cannot access chrome.* APIs. + +```json +{ + "sandbox": { + "pages": ["sandbox.html"] + } +} +``` + +Use an iframe in your extension page to embed the sandbox: + +```html + + +``` + +**CRITICAL:** Communication between the extension page and the sandboxed iframe MUST use +`postMessage`. You CANNOT access `iframe.contentDocument` or `iframe.contentWindow.document` +directly — this will throw: + +``` +SecurityError: Blocked a frame with origin "chrome-extension://..." from accessing a cross-origin frame. +``` + +Correct pattern: + +```js +// playground.js — send code to sandbox +const iframe = document.getElementById('preview'); +iframe.contentWindow.postMessage({ + html: htmlCode, + css: cssCode, + js: jsCode +}, '*'); + +// sandbox.js — receive and execute +window.addEventListener('message', (event) => { + const { html, css, js } = event.data; + // Clear previous content + document.body.innerHTML = ''; + document.head.querySelectorAll('style.user-style').forEach(s => s.remove()); + + // Apply HTML + const container = document.createElement('div'); + container.innerHTML = html; + document.body.appendChild(container); + + // Apply CSS + const style = document.createElement('style'); + style.className = 'user-style'; + style.textContent = css; + document.head.appendChild(style); + + // Execute JS (eval is allowed in sandbox!) + try { + eval(js); + } catch (e) { + const errEl = document.createElement('pre'); + errEl.style.color = 'red'; + errEl.textContent = e.message; + document.body.appendChild(errEl); + } +}); +``` + +### Option 2: Blob URL in iframe + +Create a self-contained HTML document via blob URL: + +```js +function updatePreview(htmlCode, cssCode, jsCode) { + const html = ` + + +
+ + ${htmlCode} + + + +``` + +`devtools/devtools.js`: +```js +chrome.devtools.panels.create( + 'My Panel', // Title shown in DevTools tab + 'icons/icon-16.png', // Icon (optional, can be empty string) + 'devtools/panel/panel.html', // Panel content page — RELATIVE TO EXTENSION ROOT + (panel) => { + // panel.onShown.addListener((window) => { ... }); + // panel.onHidden.addListener(() => { ... }); + } +); +``` + +**CRITICAL: The panel path is relative to the extension root**, NOT relative to the devtools.js +file. This is the most common DevTools extension bug. + +```js +// ❌ WRONG — resolves to