ZEN-mode
by
noromanba
2014-01-16 [2014/01/16 03:23:22]
(Forked from
≡ by
noromanba)
simulate small-screen mode likes embed Opera (K-tai, Wii et al.)
@@ -14,7 +14,14 @@
style.setProperty('max-width', '70%', 'important');
style.setProperty('font-size', '28px', 'important');
+ Array.prototype.slice.call(document.images).forEach(function (img) {
+ //if(!img.src || !/\.(jpe?g|png|gif)(\?|$)/i.test(img.src)) return;
+
+ //img.tabIndex = img.tabIndex || 0;
+ img.style.maxWidth = '100%';
+ });
+
Array.prototype.slice.call(document.styleSheets).forEach(function (css) {
- css.disabled = true;
+ css.disabled = true;
});
})();
/*
* @title ZEN-mode
* @description simulate small-screen mode likes embed Opera (K-tai, Wii et al.)
* @include http://*
* @include https://*
* @license MIT License http://nrm.mit-license.org/2013
* @require
*/
(function () {
var style = document.body.style;
style.setProperty('margin-left', 'auto', 'important');
style.setProperty('margin-right', 'auto', 'important');
style.setProperty('max-width', '70%', 'important');
style.setProperty('font-size', '28px', 'important');
Array.prototype.slice.call(document.images).forEach(function (img) {
//if(!img.src || !/\.(jpe?g|png|gif)(\?|$)/i.test(img.src)) return;
//img.tabIndex = img.tabIndex || 0;
img.style.maxWidth = '100%';
});
Array.prototype.slice.call(document.styleSheets).forEach(function (css) {
css.disabled = true;
});
})();
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。