Instagram mobile on Desktop Fix

Change the User Agent on Instagram to use mobile version on Desktop

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Instagram mobile on Desktop Fix
// @namespace    none
// @version      1.0.1
// @description  Change the User Agent on Instagram to use mobile version on Desktop
// @icon         https://www.google.com/s2/favicons?domain=Instagram.com
// @author       k9120303
// @match        https://www.instagram.com/
// @include      https://www.Instagram.com/*
// @match        https://instagram.com/
// @include      https://Instagram.com/*
// @grant        none
// @run-at document-start
// ==/UserScript==

Object.defineProperty(navigator, 'userAgent', {
    value: 'Mozilla/5.0 (Linux; Android 11) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Mobile Safari/537.36'
});

Object.defineProperty(window, 'innerWidth', {
  writable: true,
  configurable: true,
  value: 640,
});

document.getElementById("react-root").style.maxWidth = "640px";
document.getElementById("react-root").style.margin = '0 auto';