Google Image Search Button

Adds a button for Google Image Search on the Google start page.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

Bạn sẽ cần cài đặt một tiện ích mở rộng như Tampermonkey hoặc Violentmonkey để cài đặt kịch bản này.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Google Image Search Button
// @namespace    https://www.google.com/
// @version      1
// @description  Adds a button for Google Image Search on the Google start page.
// @author       AlifTheLegend
// @match        https://www.google.com/
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // Create the button element
    var button = document.createElement("button");
    button.innerHTML = "Google Images";
    button.style.backgroundColor = "#4285f4";
    button.style.color = "white";
    button.style.border = "none";
    button.style.margin = "0 10px";
    button.style.padding = "10px 20px";
    button.style.borderRadius = "4px";

    // Add an event listener to the button
    button.addEventListener ("click", function() {
        // Redirect to Google Images
        window.location.href = "https://www.google.com/search?tbm=isch";
    });

    // Add the button to the page
    var div = document.createElement("div");
    div.style.textAlign = "center";
    div.appendChild(button);

    var searchform = document.querySelector("#tsf");
    searchform.appendChild(div);
})();