Skip to content
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

Add support for logged out 404 pages #174

Merged
merged 4 commits into from
Jul 4, 2023

Conversation

gamemaker1
Copy link
Contributor

Overview

When logged in and in the file tree, GitHub changes the page title to File not found if the requested file/folder is missing.

However, when logged out or an issue/pr is not found, the page title is changed to Page not found.

This PR updates the is404 function to reflect the above change.

Test URLs

Merging this PR will be the first step in fixing https://github.com/refined-github/refined-github/blob/main/source/features/useful-not-found-page.tsx :)

@fregante fregante changed the title fix(is404): add condition for not found page when logged in Add support for logged out 404 pages Jun 8, 2023
@fregante
Copy link
Member

fregante commented Jun 8, 2023

Note that logged out pages are generally not supported by Refined GitHub and we don't add extra code to support them. This PR can be an exception to that rule

@gamemaker1
Copy link
Contributor Author

Should I add any tests? I didn't find any for the is404 function.

@fregante
Copy link
Member

test('is404', t => {

@gamemaker1
Copy link
Contributor Author

I think the last test will fail now since we also check for Page Not Found:

document.title = 'Page not found · Issue #266 · sintaxi/surge · GitHub';

@fregante
Copy link
Member

The tests are not failing in the current PR

@gamemaker1
Copy link
Contributor Author

gamemaker1 commented Jun 12, 2023

Oh right lol

- make sure the `File not found · GitHub` case works too
@fregante fregante merged commit 4f25492 into refined-github:main Jul 4, 2023
@fregante fregante added the enhancement New feature or request label Jul 4, 2023
@gamemaker1 gamemaker1 deleted the patch-1 branch July 5, 2023 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

2 participants