Skip to content

Restore search/report links in Safari's console#9069

Merged
fregante merged 4 commits into
mainfrom
copilot/fix-search-report-links-safari
Mar 11, 2026
Merged

Restore search/report links in Safari's console#9069
fregante merged 4 commits into
mainfrom
copilot/fix-search-report-links-safari

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 10, 2026

Safari masks extension stack URLs as webkit-masked-url://hidden/ instead of chrome-extension:// / moz-extension://, so the unhandledrejection guard in catchErrors() never matched, silently swallowing errors without logging the Search/Report links.

  • source/helpers/errors.ts: extend the stack URL check to also accept webkit-masked-url://, silencing the @typescript-eslint/prefer-nullish-coalescing lint rule with a comment explaining it's a false positive (|| is used on booleans, not nullish values):
- if (error?.stack.includes('-extension://')) {
+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- False positive: `||` is used on booleans, not nullish values
+ if (error?.stack.includes('-extension://') || error?.stack.includes('webkit-masked-url://')) {

Test URLs

N/A — console output only; repro via #8216

Screenshot

Chrome (before/expected) Safari (before → broken)

After this fix, Safari should show the same Search/Report issue links as Chrome.

Original prompt

This section details on the original issue you should resolve

<issue_title>Search/report links not appearing in Safari's console</issue_title>
<issue_description>

Chrome

Screenshot 2

Safari

Screenshot

Repro

You can follow the repro in #8216 to see those errors in the console

Likely cause: #8077 (comment)

Extension version

24.12.20

Browser(s) used

Safari 18.2
</issue_description>

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

@fregante The stack looks like this: 😬 ``` ElementNotFoundError@ expectElement@webkit-masked-url://hidden/:21:35 @webkit-masked-url://hidden/:66:15 ```

so the stack URL check should be dropped in Safari</comment_new>


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI changed the title [WIP] Fix search/report links not appearing in Safari's console Fix search/report links missing in Safari's console Mar 10, 2026
Copy link
Copy Markdown
Member

@fregante fregante left a comment

Choose a reason for hiding this comment

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

SGTM

@github-actions github-actions Bot added bug meta Related to Refined GitHub itself labels Mar 10, 2026
@fregante fregante marked this pull request as ready for review March 10, 2026 14:17
@fregante fregante enabled auto-merge (squash) March 10, 2026 14:17
@fregante
Copy link
Copy Markdown
Member

Might cover other extensions too, but it's worth a try. Better than nothing at all.

@fregante
Copy link
Copy Markdown
Member

@copilot fix the lint error too.

auto-merge was automatically disabled March 10, 2026 14:21

Head branch was pushed to by a user without write access

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 10, 2026

@copilot fix the lint error too.

Fixed in 1e81c97. Restructured the condition to error?.stack && (error.stack.includes('-extension://') || error.stack.includes('webkit-masked-url://')) — the && guard handles the nullish case, so the || operates on definite booleans and satisfies the @typescript-eslint/prefer-nullish-coalescing rule.

@fregante
Copy link
Copy Markdown
Member

@copilot revert the change and just silence the lint rule instead. Add an explanation in the comment saying it's a false positive

@fregante fregante enabled auto-merge (squash) March 10, 2026 14:29
@fregante fregante changed the title Fix search/report links missing in Safari's console Restore search/report links in Safari's console Mar 10, 2026
…comment explaining false positive

Co-authored-by: fregante <[email protected]>
auto-merge was automatically disabled March 10, 2026 14:30

Head branch was pushed to by a user without write access

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 10, 2026

@copilot revert the change and just silence the lint rule instead. Add an explanation in the comment saying it's a false positive

Done in 9f26d8a. Reverted to the original || form and added an eslint-disable comment explaining it's a false positive.

Copilot AI changed the title Restore search/report links in Safari's console Fix search/report links missing in Safari's console Mar 10, 2026
Comment thread source/helpers/errors.ts
const error = event.reason; // Access only once
// Don't use `assertError` or it'll loop
if (error?.stack.includes('-extension://')) {
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- False positive: `||` is used on booleans, not nullish values
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Eh, the type is undefined | boolean, so it's both

@fregante fregante changed the title Fix search/report links missing in Safari's console Restore search/report links in Safari's console Mar 11, 2026
@fregante fregante merged commit e7e6eb0 into main Mar 11, 2026
16 checks passed
@SunsetTechuila SunsetTechuila deleted the copilot/fix-search-report-links-safari branch March 11, 2026 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug meta Related to Refined GitHub itself

Development

Successfully merging this pull request may close these issues.

Search/report links not appearing in Safari's console

2 participants