Enable redirect-mobile-forums by default - #6917
Conversation
|
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/")) { |
There was a problem hiding this comment.
| if (window.location.pathname.startsWith("/discuss/m/")) { | |
| if (window.location.pathname.startsWith("/discuss/m/") || window.location.pathname === "/discuss/m") { |
There was a problem hiding this comment.
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.
Co-authored-by: DNin01 <106490990+DNin01@users.noreply.github.com>
DNin01
left a comment
There was a problem hiding this comment.
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. |
relevant to #5431 |
|
Possible transfer to #6915 |
|
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. |
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