Coupang mobile site to desktop site redirect via userscript

 Here's an easy and automatic way to redirect a Coupang mobile site page to its desktop PC version.

Coupang mobile site to Coupang desktop site

I buy a fair amount of stuff on Coupang, but something that often bothered me is that the site doesn't automatically detect that you're on a PC. I often browse products on my phone at work and bookmark them to come back to later on my computer at home to read up on them more before deciding to purchase. Or people will forward me links to products via KakaoTalk. Or people post links in Facebook groups (like one I've been enjoying: Expat Grocery Gurus).

But if they shared the links from the app or the mobile site, I end up viewing the mobile site version on my PC. Annoying to have to switch over to the desktop version every time. OK, so I don't have to. But it makes it a lot easier to browse the product info on the bigger screen.

I got annoyed having to do this manually so I wrote up a userscript to take care of this for me. I'm using ViolentMonkey for this but you can use whatever else (TamperMonkey, etc) you want to manage your userscripts. 

Here's the script itself if you just want to paste it in:


// ==UserScript==

// @name Coupang mobile to desktop

// @name:ko 쿠팡 모바일 링크를 데스크톱 링크로 변경

// @description Redirect mobile links to desktop links on Coupang. Useful for when you save/share a link from your phone but view the page on your desktop PC.

// @description:ko 쿠팡 모바일웹사이트에서 쿠팡 PC버전으로 URL을 리디렉션

// @match https://m.coupang.com/*

// @run-at document-start

// @version 2.0

// @namespace https://10wontips.blogspot.com

// @license MIT

// ==/UserScript==

 

// Modified from: https://greasyfork.org/en/discussions/requests/55817-replace-string-in-an-url#comment-144849

 

if (window.top !== window.self)    // Don’t run in frames.

return;

 

var currentURL = location.href;

 

if (currentURL.match("m.coupang.com/nm")) {

location.href = location.href.replace("m.coupang.com/nm", "coupang.com/np");

};

 

if (currentURL.match("m.coupang.com/vm")) {

location.href = location.href.replace("m.coupang.com/vm", "coupang.com/vp");

};

 

// end of script


You can also install it from GreasyFork here:

🔗 Coupang mobile to desktop


Just something that worked for me so passing it along. 


Comments