Skip to content

Enable redirect-mobile-forums by default - #6917

Closed
Samq64 wants to merge 5 commits into
ScratchAddons:masterfrom
Samq64:redirect-m-by-default
Closed

Enable redirect-mobile-forums by default#6917
Samq64 wants to merge 5 commits into
ScratchAddons:masterfrom
Samq64:redirect-m-by-default

Conversation

@Samq64

@Samq64 Samq64 commented Dec 1, 2023

Copy link
Copy Markdown
Member

Closes #6910

Changes

Enables the Redirect to standard forums addon by default and adjusts the name and description to indicate that the links are broken. Also fixes a race conditon in the addon by also running on /404.

Reason for changes

All links to the mobile forums such as from google search results are broken so there's no reason not to redirect users to the correct URL by default.

Tests

Tested on Firefox 120

@Samq64 Samq64 added the scope: addon Related to one or multiple addons label Dec 1, 2023
Comment thread addons/redirect-mobile-forums/addon.json
@Samq64
Samq64 requested a review from WorldLanguages December 1, 2023 14:49
@DNin01

DNin01 commented Dec 1, 2023

Copy link
Copy Markdown
Member

Nice - I was just about to suggest this idea on one of the active PRs!

export default async function ({ addon, console, msg }) {
window.location.replace(window.location.href.replace("m/", ""));
export default async function ({ addon, console }) {
if (window.location.pathname.startsWith("/discuss/m/")) {

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.

Suggested change
if (window.location.pathname.startsWith("/discuss/m/")) {
if (window.location.pathname.startsWith("/discuss/m/") || window.location.pathname === "/discuss/m") {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

startsWith() also works if it's the full string and since it replaces m/ checking for a path without a trailing slash isn't very useful without updating the replace.

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.

Right

Comment thread addons/redirect-mobile-forums/addon.json Outdated
Co-authored-by: DNin01 <106490990+DNin01@users.noreply.github.com>

@DNin01 DNin01 left a comment

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.

Do we need to do anything else for this to be automatically enabled for existing users?

@WorldLanguages

Copy link
Copy Markdown
Member

Do we need to do anything else for this to be automatically enabled for existing users?

Yes, the easiest way is to change the addon ID.

@cobaltt7

cobaltt7 commented Dec 5, 2023

Copy link
Copy Markdown
Contributor

Do we need to do anything else for this to be automatically enabled for existing users?

relevant to #5431

@iqnite

iqnite commented Dec 11, 2023

Copy link
Copy Markdown
Contributor

Possible transfer to #6915

@Samq64

Samq64 commented Dec 21, 2023

Copy link
Copy Markdown
Member Author

Since it's been a few weeks it looks like search engines have already removed the dead links and I can find one anymore.

Edit: It's not quite the case but I won't re-open this because there's #6915.

@Samq64 Samq64 closed this Dec 21, 2023
@Samq64
Samq64 deleted the redirect-m-by-default branch December 21, 2023 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: addon Related to one or multiple addons

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove the "redirect to standard forums" addon (&/or inclusions of the mobile forums in addons)

5 participants