Last active
February 4, 2024 11:27
-
-
Save toriwasa/8d8d03e2b19e0149b3195d85b305b2b3 to your computer and use it in GitHub Desktop.
Edgeのスタート画面やアドレスバーから検索したときにBing検索からGoogle検索に飛ばすユーザースクリプト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name bing to google | |
// @namespace http://tampermonkey.net/ | |
// @version 1.0 | |
// @description Edgeのスタート画面やアドレスバーから検索したときにBing検索からGoogle検索に飛ばすユーザースクリプト | |
// @author toriwasa | |
// @match https://www.bing.com/search* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net | |
// @grant none | |
// @downloadURL https://gist.github.com/toriwasa/8d8d03e2b19e0149b3195d85b305b2b3/raw/dd8a727084baacb5491b47f903eb3ef53640b5c5/bing_to_google.user.js | |
// @updateURL https://gist.github.com/toriwasa/8d8d03e2b19e0149b3195d85b305b2b3/raw/dd8a727084baacb5491b47f903eb3ef53640b5c5/bing_to_google.user.js | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// q=以降で次の&にマッチするまでの文字列を取り出す | |
const query = document.URL.match(/q\=[^&]*/); | |
// Google検索URLを生成する | |
const googleUrl = `https://www.google.com/search?${query}`; | |
// Google検索に遷移する | |
window.location.href = googleUrl; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment