Last active
September 2, 2023 11:03
-
-
Save chriskyfung/abad63aa24af3d8226ca4f5741b6a768 to your computer and use it in GitHub Desktop.
User script to automatically redirect a Facebook mobile link to a desktop version on Chrome and Firefox with Tampermonkey
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This program is free software. It comes without any warranty, to | |
* the extent permitted by applicable law. */ | |
// ==UserScript== | |
// @name Switch to mobile to desktop version of Facebook linkes | |
// @namespace https://gist.github.com/chriskyfung/abad63aa24af3d8226ca4f5741b6a768 | |
// @description When you open a moblile version of facebook, you're redirected to desktop version so that it can view in high-resolution. | |
// @match https://m.facebook.com/* | |
// @run-at document-start | |
// @version 0.0.1 | |
// @resource LICENSE | |
// ==/UserScript== | |
var mobileURLRe = /(?:m.facebook.com|^)/; | |
if (mobileURLRe.test(document.location.href)) { | |
var target = document.location.href.replace("m.facebook", "www.facebook"); | |
window.location.replace(target) | |
} |
Alternatively, you might try the Chrome Extension called Mobile2Desktop Facebook Links by Hornobster, available on Chrome Web Store.
Dear @chriskyfung, I don't know how to use it. Can you give me an instruction? When I click on the link http://fblink_mobile2desktop.user.js/, it shows:
Hi @liwenjing93,
You must install TamperMonkey on Chrome beforehand.
Homepage: https://www.tampermonkey.net/
Hi @liwenjing93,
You must install TamperMonkey on Chrome beforehand.
Homepage: https://www.tampermonkey.net/
Dear, I am using violentmonkey, is that ok? there are some scripts do not work with TamperMonkey so I can not use it. Thanks
ViolentMonkey is ok. Just less safe because it has fewer restrictions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks Chris, this works great for me. It's funny that in 2020 you still have to do this even!