Skip to content

The error reporter hides the origin of the errors in Safari #10119

Closed

Description

@fregante

Description

  1. we load the content script in a special way to enable ESM support in content scripts https://github.com/refined-github/refined-github/blob/258655c00759874e376c2987d4e80e4cae16f35b/source/content-script.ts#L1-L3
  2. we catch error events so that we can provide links
    export function catchErrors(): void {
    globalThis.addEventListener('error', event => {
  3. safari masks the real file location in the error.stack
  4. we already have logic to exclude Safari from the catcher but it seems it's not working
    if (!(error?.stack.includes('-extension://') || error?.stack.includes('webkit-masked-url://'))) {
Image

Possible solutions

There are many ways to go around this, the best one being finding a way to support Safari in the error catcher (maybe by changing the way we support ESM), the worst one disabling the error catcher in Safari.

A middle ground that works everywhere could be to let the native errors through, but follow them with a custom log message with the links

How to replicate the issue + URL

everywhere

Extension version

26.9.24

Browser(s) used

safari

Token ⚠️

  • I set a token in the options page. I understand that some features require a token to work.

Activity

  1. added
    meta
    safari
    on Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedmetasafari

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions