crx DL link Fork

    @@ -1,38 +1,50 @@ /* * @title crx DL link - * @description prompt crx download-link on Chrome Web Store + * @description prompt download-link of Chrome Extension aka crx on Chrome Web Store * @include https://chrome.google.com/webstore/detail/* - * @contributor taizooo http://let.hatelabo.jp/taizooo/let/gYC-x-e5r_G0bw (Fork of) - * @contributor noromanba http://let.hatelabo.jp/noromanba/let/hLHX5-ST-aMn - * @license MIT License http://opensource.org/licenses/MIT + * @contributor taizooo http://let.hatelabo.jp/taizooo/let/gYC-x-e5r_G0bw (Fork of) + * @license MIT License https://opensource.org/licenses/MIT * @javascript_url */ - // http://stackoverflow.com/questions/7184793/how-to-download-a-crx-file-from-the-chrome-web-store-for-a-given-id + // https://stackoverflow.com/questions/7184793/how-to-download-a-crx-file-from-the-chrome-web-store-for-a-given-id // http://0-9.tumblr.com/post/52782603407/chrome-extension-development-casual - (function () { + (() => { + 'use strict'; + // http://let.hatelabo.jp/noromanba/let/hLHVzOTQjfYH - var canonical = function () { - var url = (document.head.querySelector('meta[property="og:url"][content]') || {}).content || - (document.head.querySelector('link[rel="canonical"][href]') || {}).href || - location.href; + // https://gist.github.com/noromanba/d730ccf3ae5e6916cd60 + // https://gist.github.com/noromanba/3705f2e9ebb8538328b2f3f9a6f1a9b3 + const canonical = () => { + const url = (document.head.querySelector([ + 'meta[property="og:url"][content]' + ]) || {}).content || + (document.head.querySelector([ + 'link[rel="canonical"][href]' + ]) || {}).href || + location.href; // https://developer.mozilla.org/en-US/docs/Web/API/URL // https://developer.mozilla.org/en-US/docs/Web/API/URL.URL return new URL(url); }; - var id = canonical().pathname.split('/').filter(function (s) { return !!s; } ).pop(); - var link = [ - // can use https - 'http://clients2.google.com/service/update2/crx?response=redirect&x=id%3D', + // dev-doc c.f. + // https://gist.github.com/noromanba/5776183 + + // url syntax of Extension page; + // https://chrome.google.com/webstore/detail/[<EXTENSION_NAME>]/<EXTENSION_ID>[/] + const id = canonical().pathname.split('/').filter(s => !!s).pop(); + const link = [ + // You can use http, but final url redirect to https + 'https://clients2.google.com/service/update2/crx?response=redirect&x=id%3D', id, '%26uc', - // 32 or higher e.g. 33, 64. OBSOLETE "&prod=chrome" + // 32 or higher e.g. 33, 64 '&prodversion=32' + // OBSOLETE "&prod=chrome" ].join(''); - prompt('Copy Me', link); + window.prompt('.crx raw link', link); })(); - // dev-doc https://gist.github.com/noromanba/5776183
  • /*
     * @title crx DL link
     * @description prompt download-link of Chrome Extension aka crx on Chrome Web Store
     * @include https://chrome.google.com/webstore/detail/*
     * @contributor taizooo http://let.hatelabo.jp/taizooo/let/gYC-x-e5r_G0bw (Fork of)
     * @license MIT License https://opensource.org/licenses/MIT
     * @javascript_url
     */
    
    // https://stackoverflow.com/questions/7184793/how-to-download-a-crx-file-from-the-chrome-web-store-for-a-given-id
    // http://0-9.tumblr.com/post/52782603407/chrome-extension-development-casual
    
    (() => {
      'use strict';
    
      // http://let.hatelabo.jp/noromanba/let/hLHVzOTQjfYH
      // https://gist.github.com/noromanba/d730ccf3ae5e6916cd60
      // https://gist.github.com/noromanba/3705f2e9ebb8538328b2f3f9a6f1a9b3
      const canonical = () => {
        const url = (document.head.querySelector([
          'meta[property="og:url"][content]'
        ]) || {}).content ||
          (document.head.querySelector([
             'link[rel="canonical"][href]'
          ]) || {}).href ||
          location.href;
          // https://developer.mozilla.org/en-US/docs/Web/API/URL
          // https://developer.mozilla.org/en-US/docs/Web/API/URL.URL
          return new URL(url);
      };
    
      // dev-doc c.f.
      // https://gist.github.com/noromanba/5776183
    
      // url syntax of Extension page;
      // https://chrome.google.com/webstore/detail/[<EXTENSION_NAME>]/<EXTENSION_ID>[/]
      const id = canonical().pathname.split('/').filter(s => !!s).pop();
      const link = [
        // You can use http, but final url redirect to https
        'https://clients2.google.com/service/update2/crx?response=redirect&x=id%3D',
        id,
        '%26uc',
        // 32 or higher e.g. 33, 64
        '&prodversion=32'
        // OBSOLETE "&prod=chrome"
      ].join('');
    
      window.prompt('.crx raw link', link);
    })();
    
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2017/03/01 21:48:21 - 03/01
  2. 2017/02/28 19:48:16 - 02/28
  3. 2017/02/28 19:44:40 - 02/28
  4. 2014/11/05 21:52:07 - 2014-11-05
  5. 2014/11/05 21:37:03 - 2014-11-05
  6. 2014/02/10 20:33:54 - 2014-02-10
  7. 2013/06/13 18:57:23 - 2013-06-13
  8. 2013/06/13 18:56:40 - 2013-06-13
  9. 2013/06/13 17:30:48 - 2013-06-13
  10. 2013/06/13 17:27:14 - 2013-06-13
  11. 2013/06/13 16:27:48 - 2013-06-13
  12. 2013/06/13 15:58:32 - 2013-06-13