PageSourceSearch

https://yujiangpu20.github.io/assets/js/viewport-fix.js

js yujiangpu20.github.io collected 2026-10-03 10:13:42 UTC 680 bytes, 29 lines download raw bytes

1(function (document) {
2  var viewportMeta = document.querySelector('meta[name="viewport"]');
3
4  if (!viewportMeta || !navigator.userAgent.match(/iPhone/i)) {
5    return;
6  }
7
8  function setViewport(content) {
9    viewportMeta.content = content;
10  }
11
12  function initialize() {
13    setViewport('width=device-width, minimum-scale=1.0, maximum-scale=1.0');
14  }
15
16  function handleGestureStart() {
17    setViewport('width=device-width, minimum-scale=0.25, maximum-scale=1.6');
18  }
19
20  initialize();
21  document.addEventListener('touchstart', handleGestureStart, false);
22  document.addEventListener(
23    'touchend',
24    function () {
25      initialize();
26    },
27    false
28  );
29})(document);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.