v
by
noromanba
2018-02-16 [2018/02/16 14:53:52]
dumb jump to bottom of page; [Ctrl +] End alternatives
@@ -1,8 +1,8 @@
/*
* @title ⤓
* @description dumb jump to bottom of page; [Ctrl +] End alternative
- * @include http:*
- * @include https:*
+ * @include http://*
+ * @include https://*
* @license MIT License https://opensource.org/licenses/MIT
* @javascript_url
*/
@@ -15,14 +15,26 @@
(() => {
'use strict';
- // XXX `Infinity` is fallback/workaround for IE
- // You can use `Number.MAX_VALUE` BUT exponential;
- // 'ts so hard to try decimalization before truncate c.f.
- // https://stackoverflow.com/questions/18719775/parsing-and-converting-exponential-values-to-decimal-in-javascript
+ //*/ boring...
+ window.scrollTo(0, document.body.clientHeight);
+ /*/
window.scrollTo(0, Number.MAX_SAFE_INTEGER || Infinity);
+ // XXX `Infinity` is fallback/workaround for IE (might be fixed) c.f.
+ // https://hail2u.net/blog/coding/window-scrollto-infinity-infinity.html
+ //
+ // You can use `Number.MAX_VALUE` BUT exponential;
+ // 'ts so hard to try decimalization before truncate c.f.
+ // https://stackoverflow.com/questions/18719775/parsing-and-converting-exponential-values-to-decimal-in-javascript
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER
+ //
+ // FIXME do not working on Firefox 58.0.2 Desktop;
+ // due to Infinite Scrolling Extensions?
+ // `Number.MAX_SAFE_INTEGER` works well on Firefox 58.0.2 mobile
+ //*/
})();
/* for mobile
javascript:window.scrollTo(0,Number.MAX_SAFE_INTEGER)
+javascript:window.scrollTo(0,document.body.clientHeight)
*/
/*
* @title ⤓
* @description dumb jump to bottom of page; [Ctrl +] End alternative
* @include http://*
* @include https://*
* @license MIT License https://opensource.org/licenses/MIT
* @javascript_url
*/
// via
// https://hail2u.net/blog/coding/window-scrollto-infinity-infinity.html
// avoid Magic Number e.g.
// 99999..., 10000... and 1e100...
(() => {
'use strict';
//*/ boring...
window.scrollTo(0, document.body.clientHeight);
/*/
window.scrollTo(0, Number.MAX_SAFE_INTEGER || Infinity);
// XXX `Infinity` is fallback/workaround for IE (might be fixed) c.f.
// https://hail2u.net/blog/coding/window-scrollto-infinity-infinity.html
//
// You can use `Number.MAX_VALUE` BUT exponential;
// 'ts so hard to try decimalization before truncate c.f.
// https://stackoverflow.com/questions/18719775/parsing-and-converting-exponential-values-to-decimal-in-javascript
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER
//
// FIXME do not working on Firefox 58.0.2 Desktop;
// due to Infinite Scrolling Extensions?
// `Number.MAX_SAFE_INTEGER` works well on Firefox 58.0.2 mobile
//*/
})();
/* for mobile
javascript:window.scrollTo(0,Number.MAX_SAFE_INTEGER)
javascript:window.scrollTo(0,document.body.clientHeight)
*/
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。