Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 29, 2025

Extension was processing pages and adding data-ds-ready attribute on localhost even when "Work On Localhost" setting was disabled (the default).

Changes

  • Added isLocalhost() helper to detect localhost URLs (localhost, 127.0.0.1, [::1], *.localhost)
  • Modified isEnabled() to check enableOnLocalhost setting when on localhost URLs
export const isLocalhost = (hostname: string): boolean => {
  return (
    hostname === "localhost" ||
    hostname === "127.0.0.1" ||
    hostname === "[::1]" ||
    hostname.endsWith(".localhost")
  );
};

When enableOnLocalhost is false (default), isEnabled() now returns false for localhost URLs, preventing content script processing.

Original prompt

This section details on the original issue you should resolve

<issue_title>The extension works on localhost even if disabled</issue_title>
<issue_description>The extensio on localhost even if "Work On Localhost" option is disabled still adds things like data-ds-ready to the page

Helium 0.6.7.1 (arm64)
Chromium 142.0.7444.175
```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Add check for localhost URLs in isEnabled() function to respect
the enableOnLocalhost setting. When on localhost (127.0.0.1, localhost,
[::1], or *.localhost) and enableOnLocalhost is disabled (default),
the extension will not process the page or add data-ds-ready attribute.

Co-authored-by: clemenzi <77632836+clemenzi@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 29, 2025

Deploying with  Cloudflare Workers  Cloudflare Workers

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

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
dontshow aefd8ac Nov 29 2025, 09:54 AM

Copilot AI changed the title [WIP] Fix extension behavior on localhost when disabled Fix extension processing localhost when enableOnLocalhost is disabled Nov 29, 2025
Copilot AI requested a review from clemenzi November 29, 2025 09:57
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.

The extension works on localhost even if disabled

2 participants