您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Very useful for those who use google.com with user agent of old browsers
- // ==UserScript==
- // @name viewport = device width for google.com
- // @namespace http://example.com/viewport-for-google
- // @match https://www.google.com/search?*tbm=isch*
- // @run-at document-start
- // @grant none
- // @version 0.1
- // @author Rishabh
- // @description Very useful for those who use google.com with user agent of old browsers
- // ==/UserScript==
- (function() {
- 'use strict';
- const tag = document.createElement('meta');
- tag.setAttribute("name", "viewport");
- tag.setAttribute("content", "width=device-width, initial-scale=1");
- function insertMetaTag() {
- if (!document.head.contains(tag)) {
- document.head.appendChild(tag);
- }
- }
- if (document.head) {
- insertMetaTag();
- } else {
- document.addEventListener("DOMContentLoaded", insertMetaTag);
- }
- })();