-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Back/forth navigation is delayed #6028
Comments
Thanks for the debugging. I don't see anything that Refined GitHub could interact with, we don't deal with navigation. The only thing we do occasionally is mark our own links with an old "ajaxed" marker, but you clicked a native link so that's not covered. If you can replicate it consistently, would you mind using "Find feature..." in Refines GitHub's options page? |
Do you have other extensions installed? Like Octotree |
Holy shit you prepared here. bisect gives https://github.com/refined-github/refined-github/blob/main/source/features/linkify-user-location.tsx (I had all extensions disabled, I don't have many and not Octotree anyway.) But disabling this feature then has no effect. A second bisect had the same result. |
If I start the bisect with With all three disabled the bug is gone. |
It waits for a style element here which has the following content
|
It's unclear why GitHub would pick our Unfortunately it's not available in Safari yet, so we'd have to "polyfill" it https://developer.mozilla.org/en-US/docs/Web/API/Document/adoptedStyleSheets#browser_compatibility |
But the
|
The content of
I think it's just a coincidence or a bug of the browser
I do see an "issue" in it, the selectors appear to be duplicated somehow, This is in a readable form: @keyframes rgh-selector-observer {}
:where(.BorderGrid--spacious .f4.my-3,.js-commits-list-item pre,.js-commit-group .pr-1 code,.js-commit-group pre,.release-header,.Box-row .mb-1 a,#pull-requests a.Link--primary,[id^="check_suite"] a.Link--primary,.js-socket-channel[data-url*="/header_partial"] h3,.js-wiki-sidebar-toggle-display a,#wiki-wrapper .gh-header-title,.issues_labeled .color-fg-default > a,#user-repositories-list [itemprop="description"],.js-hovercard-content > .Popover-message .Link--primary,.js-discussions-title-container h1 > .js-issue-title,a[data-hovercard-type="discussion"]):not(.rgh-seen-11509184296) {
animation: 1ms rgh-selector-observer;
}
:where(.comment-body a[href]:not(.rgh-linkified-code)):not(.rgh-seen-2855538752) {
animation: 1ms rgh-selector-observer;
}
:where(.BorderGrid--spacious .f4.my-3,.js-commits-list-item pre,.js-commit-group .pr-1 code,.js-commit-group pre,.release-header,.Box-row .mb-1 a,#pull-requests a.Link--primary,[id^="check_suite"] a.Link--primary,.js-socket-channel[data-url*="/header_partial"] h3,.js-wiki-sidebar-toggle-display a,#wiki-wrapper .gh-header-title,.issues_labeled .color-fg-default > a,#user-repositories-list [itemprop="description"],.js-hovercard-content > .Popover-message .Link--primary,.js-discussions-title-container h1 > .js-issue-title,a[data-hovercard-type="discussion"]):not(.rgh-seen-11509184296) {
animation: 1ms rgh-selector-observer;
}
:where(.BorderGrid--spacious .f4.my-3,.js-commits-list-item pre,.js-commit-group .pr-1 code,.js-commit-group pre,.release-header,.Box-row .mb-1 a,#pull-requests a.Link--primary,[id^="check_suite"] a.Link--primary,.js-socket-channel[data-url*="/header_partial"] h3,.js-wiki-sidebar-toggle-display a,#wiki-wrapper .gh-header-title,.issues_labeled .color-fg-default > a,#user-repositories-list [itemprop="description"],.js-hovercard-content > .Popover-message .Link--primary,.js-discussions-title-container h1 > .js-issue-title,a[data-hovercard-type="discussion"]):not(.rgh-seen-11509184296) {
animation: 1ms rgh-selector-observer;
}
:where(.BorderGrid--spacious .f4.my-3,.js-commits-list-item pre,.js-commit-group .pr-1 code,.js-commit-group pre,.release-header,.Box-row .mb-1 a,#pull-requests a.Link--primary,[id^="check_suite"] a.Link--primary,.js-socket-channel[data-url*="/header_partial"] h3,.js-wiki-sidebar-toggle-display a,#wiki-wrapper .gh-header-title,.issues_labeled .color-fg-default > a,#user-repositories-list [itemprop="description"],.js-hovercard-content > .Popover-message .Link--primary,.js-discussions-title-container h1 > .js-issue-title,a[data-hovercard-type="discussion"]):not(.rgh-seen-11509184296) {
animation: 1ms rgh-selector-observer;
}
:where(.BorderGrid--spacious .f4.my-3,.js-commits-list-item pre,.js-commit-group .pr-1 code,.js-commit-group pre,.release-header,.Box-row .mb-1 a,#pull-requests a.Link--primary,[id^="check_suite"] a.Link--primary,.js-socket-channel[data-url*="/header_partial"] h3,.js-wiki-sidebar-toggle-display a,#wiki-wrapper .gh-header-title,.issues_labeled .color-fg-default > a,#user-repositories-list [itemprop="description"],.js-hovercard-content > .Popover-message .Link--primary,.js-discussions-title-container h1 > .js-issue-title,a[data-hovercard-type="discussion"]):not(.rgh-seen-11509184296) {
animation: 1ms rgh-selector-observer;
}
Unfortunately it seems that some elements are removed by turbo, see #5857 Does Turbo has an easy way to exclude our |
Judging by the code in https://github.com/hotwired/turbo/blob/4e8ba783419cc01c0aa42d01cbca313e28b35016/src/core/drive/head_snapshot.ts#L47, |
|
Do these events fire if you add the same element a second time to head? (They don't deduplicate?) (noobish, I know) "error" should be triggered when there is an error in the selector for example I guess. So "error" is; "I've seen this but I (the browser) cannot apply it; It is not in effect now." |
Even if it doesn't cover every browser, it'd be good to have a helper like: function attachStyleSheet(css: string): CSSStyleSheet {
if ('adoptedStylesheets' in document) {
const sheet = new CSSStyleSheet(css);
document.adoptedStylesheets = [sheet]
return sheet;
}
const sheet = document.createElement('style')
sheet.textContent = css;
document.head.append(sheet)
return sheet;
} |
In case it wasn't fully confirmed, this is definitely caused by parse-backticks for me |
I don't want to open a new issue ticket if it's not needed, so allow me to ask; could this be the same issue that is causing files to load slower, at least on Firefox, while Refined GitHub is enabled? I noticed that if I open a .c file with a considerable amount of lines such as 8k to 10k on GitHub.com with Refined GitHub enabled, it takes an extra 20 to 30 seconds to load compared to what it takes to load the same file with Refined GitHub disabled. For reference, a file with 8266 lines loads up in ~5 seconds without Refined GitHub on my end, where as it takes around 22 while it is enabled. |
Description
See detailed below:
How to replicate the issue
I count roughly to 2 (seconds).
The performance tab shows nada, just wait time
The starting task (on the right) after the presumed waiting is a timer
pointing to
which has this code
So it looks like we timeout after 2000 and that's also the delay I have. What's interesting is that we wait for a
style
element here.Without refined enabled, I don't run this code here. T.i. with Refined this code here starts with a on history.pop event ("Going forth" navigation). Without Refined there is some flag, some
this.enabled
somewhere I forgot, which isfalse
so we never reach much further in the code.I'm actually no expert here, this is hooray let's start a debugger I've not used for years, so everything can really be wrong here.
Extension version
22.9.25
Browser(s) used
brave
The text was updated successfully, but these errors were encountered: