Skip to content

(extension) fix video detection not working on http origin [DA-409]#332

Merged
Mr-Quin merged 3 commits intomasterfrom
DA-409_video-detection-not-working-on-http-origin
Mar 21, 2026
Merged

(extension) fix video detection not working on http origin [DA-409]#332
Mr-Quin merged 3 commits intomasterfrom
DA-409_video-detection-not-working-on-http-origin

Conversation

@Mr-Quin
Copy link
Owner

@Mr-Quin Mr-Quin commented Mar 21, 2026

No description provided.

@Mr-Quin Mr-Quin self-assigned this Mar 21, 2026
Copilot AI review requested due to automatic review settings March 21, 2026 00:40
@Mr-Quin
Copy link
Owner Author

Mr-Quin commented Mar 21, 2026

Task linked: DA-409 自动化未检测到视频

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an issue where the extension's video detection was failing on HTTP origins by broadening the content script's URL matching permissions. Additionally, it enhances the development workflow by introducing dedicated scripts for running the extension in development and standalone modes, and standardizes UUID generation within the player service.

Highlights

  • Extension Permissions: Updated the extension's content script permissions to "<all_urls>" to ensure video detection works across all HTTP and HTTPS origins, resolving an issue with HTTP origins.
  • Development Scripts: Added new pnpm scripts, dev:extension and dev:extension:standalone, to streamline the development workflow for the extension.
  • UUID Generation: Switched from crypto.randomUUID() to a custom getRandomUUID() utility for generating document IDs within the player script, standardizing UUID generation.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 21, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
danmaku-anywhere-web 5cba87d Commit Preview URL

Branch Preview URL
Mar 21 2026, 12:45 AM

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly fixes an issue preventing video detection on HTTP origins by providing a fallback for crypto.randomUUID(), which is unavailable in insecure contexts. The changes also include adding development scripts to package.json and updating the extension manifest. I've included one suggestion to refine the manifest permissions to adhere more closely to the principle of least privilege.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts the browser extension’s content-script bootstrap to keep video/player detection working on non-secure (HTTP) pages, and adds convenience scripts for extension development.

Changes:

  • Replace crypto.randomUUID() usage in the player content script with getRandomUUID() (fallback-safe UUID generation).
  • Broaden the player content script matches pattern to '<all_urls>'.
  • Add root package.json scripts for extension dev workflows.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/danmaku-anywhere/src/content/player/PlayerScript.service.ts Use a UUID helper that won’t crash on origins where crypto.randomUUID() is unavailable/throws.
packages/danmaku-anywhere/manifest.ts Change player content script match patterns to run on '<all_urls>'.
package.json Add dev:extension and dev:extension:standalone convenience scripts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Mr-Quin Mr-Quin merged commit 49cc841 into master Mar 21, 2026
12 checks passed
@Mr-Quin Mr-Quin deleted the DA-409_video-detection-not-working-on-http-origin branch March 21, 2026 00:50
@Mr-Quin Mr-Quin added the preview release Create a preview release label Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview release Create a preview release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants