sindresorhus/refined-github

`raw-file-link` hangs the progress bar in PR comparisons forever #4143

altrisi posted onGitHub

When you click the View raw button created by raw-file-link in a PR, Github will understand it as a pjax request and won't ever reach the the raw file since a NetworkError will occur (CSP). Reloading the page then will, since the url has already been changed. Also works by middle-clicking the button, since it will open the url directly in a new tab.

Test URLs:

Console errors:

[Error] Content Security Policy: Las opciones para esta página han bloqueado la carga de un recurso en https://raw.githubusercontent.com/sindresorhus/refined-github/3f6bf6d9083d02851a7beaf9e16dbadefb697805/source/features/bugs-tab.tsx (connect-src). (~"Options for this page have blocked the load of a resource at raw... (connect-src)")

[Error] Uncaught (in promise) TypeError: NetworkError when attempting to fetch resource.

    ue pjax.ts:304
    AsyncFunctionThrow self-hosted:694
    (AsĂ­ncrono: async)
    execute navigation.ts:62
    execute navigation.ts:17
    X index.js:96
    (AsĂ­ncrono: EventListener.handleEvent)
    o index.js:113
    execute ajax-error.ts:51
    register/e[i]< system-lite.js:20
    (AsĂ­ncrono: promise callback)
    register system-lite.js:19
    <anonymous> chunk-frameworks-b6fcaece.js:1

("AsĂ­ncrono" == "async")

No console errors specifically from this feature, but (although it doesn't seem related), close-out-of-view-modals threw Modal was closed too quickly. Disabled feature.

Tested using Firefox in case it makes a difference. Also, it works correctly in commit pages.


@fregante can we add if isPrFiles onClick={location.reload()} or is it better to do delegate?

posted by yakov116 about 4 years ago

GitHub has a class to disable ajax on links. We just need to add that class (or attribute)

posted by fregante about 4 years ago

I think (cant test since the url is broken) its data-skip-pjax. (Putting here so I can go back later)

Tested its data-skip-pjax

posted by yakov116 about 4 years ago

Fund this Issue

$0.00
Funded

Pull requests