Last active
February 11, 2023 10:10
-
-
Save abcang/8088f536bc5473491e41eb2b786d24a5 to your computer and use it in GitHub Desktop.
Twitter PWA Narrow Width
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
// ==UserScript== | |
// @name Twitter PWA Narrow Width | |
// @namespace https://gist.github.com/abcang/8088f536bc5473491e41eb2b786d24a5/raw/twitter-pwa-narrow-width.user.js | |
// @version 0.1 | |
// @description TwitterのPWAの画面幅を狭くする | |
// @author abcang | |
// @match https://twitter.com/* | |
// @grant none | |
// @downloadURL https://gist.github.com/abcang/8088f536bc5473491e41eb2b786d24a5/raw/twitter-pwa-narrow-width.user.js | |
// @updateURL https://gist.github.com/abcang/8088f536bc5473491e41eb2b786d24a5/raw/twitter-pwa-narrow-width.user.js | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// PWA以外では動かさない | |
if (!window.matchMedia('(display-mode: standalone)').matches) { | |
return | |
} | |
const css =` | |
* { | |
max-width: 400px; | |
} | |
`; | |
const style = document.createElement('style'); | |
style.appendChild(document.createTextNode(css)); | |
document.head.appendChild(style); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment