Skip to content

Instantly share code, notes, and snippets.

@abcang
Last active February 11, 2023 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abcang/8088f536bc5473491e41eb2b786d24a5 to your computer and use it in GitHub Desktop.
Save abcang/8088f536bc5473491e41eb2b786d24a5 to your computer and use it in GitHub Desktop.
Twitter PWA Narrow Width
// ==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