How does Chrome's “Request Desktop Site” option work?

前端 未结 4 1708
半阙折子戏
半阙折子戏 2020-12-04 10:46

For iOS google chrome, when a user hits the \"Request desktop site\" button what does the browser do to try to bring up a desktop site? I imagine some sort of header on the

4条回答
  •  青春惊慌失措
    2020-12-04 11:36

    This javascript snippet will effectively do the same :

    function requestDesktopSite() {
        document.getElementsByTagName('meta')['viewport'].content='min-width: 980px;';
    }

提交回复
热议问题