浏览代码

Add viewport meta

This is only added to the original js file
Lucian I. Last 6 年之前
父节点
当前提交
ab47754beb
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      examples/bookmarklet/source.js

+ 7 - 0
examples/bookmarklet/source.js

@@ -16,6 +16,12 @@ javascript:(function() {
         element.href = path;
         element.href = path;
         element.rel = 'stylesheet';
         element.rel = 'stylesheet';
         head.appendChild(element);
         head.appendChild(element);
+    },
+    _createViewPort = function() {
+      var element = document.createElement('meta');
+      element.name = "viewport";
+      element.content = "width=device-width, initial-scale=1";
+      head.appendChild(element);
     };
     };
 
 
     _createScript('https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js', function() {
     _createScript('https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js', function() {
@@ -23,4 +29,5 @@ javascript:(function() {
             file.match(/css$/) ? _createStyle(file) : _createScript(file);
             file.match(/css$/) ? _createStyle(file) : _createScript(file);
         });
         });
     });
     });
+    _createViewPort();
 })();
 })();