Skip to content

Instantly share code, notes, and snippets.

@toriwasa
Last active February 4, 2024 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toriwasa/8d8d03e2b19e0149b3195d85b305b2b3 to your computer and use it in GitHub Desktop.
Save toriwasa/8d8d03e2b19e0149b3195d85b305b2b3 to your computer and use it in GitHub Desktop.
Edgeのスタート画面やアドレスバーから検索したときにBing検索からGoogle検索に飛ばすユーザースクリプト
// ==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