Force user-scalable=yes

  • /*
     * @title Force user-scalable=yes
     * @description user-scalable=noになっているページを強制的にuser-scalable=yesにします
     * @include http://*
     * @license MIT License
     * @require 
     */
    (function () {
        var metaE = document.querySelector('meta[name=viewport]');
        // normalize('hauhau=1, homuhomu=2; mamimami=3;' -> 'hauhau=1,homuhomu=2,mamimami=3')
        var content = metaE.content.split(/[,;]\s*/).filter(function (e) { return e != "" }).join(',');
        metaE.content = content.replace(/maximum-scale=[^,]+/gi, 'maximum-scale=10.0')
                               .replace(/user-scalable=[^,]+/gi, 'user-scalable=yes');
    })();
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2011/10/15 16:25:50 - 2011-10-15
  2. 2011/10/15 16:25:24 - 2011-10-15
  3. 2011/10/15 16:20:39 - 2011-10-15
  4. 2011/10/15 15:59:34 - 2011-10-15