Sorry, Google!

Take your search elsewhere on the "/sorry" captcha pages Google serves when you use a VPN. Hold CTRL while clicking to open in a new tab.

  1. // ==UserScript==
  2. // @name Sorry, Google!
  3. // @namespace https://github.com/appel/userscripts
  4. // @version 0.4.1
  5. // @description Take your search elsewhere on the "/sorry" captcha pages Google serves when you use a VPN. Hold CTRL while clicking to open in a new tab.
  6. // @author Ap
  7. // @match *://www.google.com/sorry/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function () {
  13. 'use strict';
  14.  
  15. const extractQuery = (url) => {
  16. const match = url.match(/q%3D(.*?)%26|q%3D(.*?)(?=&|$)/);
  17. if (match) {
  18. const queryComponent = match[1] || match[2];
  19. return decodeURIComponent(queryComponent.replace(/\+/g, ' '));
  20. }
  21. return '';
  22. };
  23.  
  24. const searchButton = (query, baseUrl, text) => {
  25. const url = `${baseUrl}${query}`;
  26. const link = document.createElement('a');
  27. link.href = url;
  28. link.target = '_parent';
  29. link.title = `Take this search to ${text}`;
  30. link.textContent = text;
  31. link.style = `display: inline-block; margin-top: 2rem; margin-right: .5rem; padding: 0.35rem .75rem;
  32. background-color: #302e2d; color: #ffffff; border-radius: 5px;
  33. text-decoration: none; font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir,
  34. segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif;
  35. font-size: 17px;`;
  36.  
  37. // Hold ctrl while clicking to open in a new tab
  38. link.addEventListener('click', (event) => {
  39. if (event.ctrlKey) {
  40. link.target = '_blank'; // Opens in a new tab
  41. } else {
  42. link.target = '_parent'; // Opens in the same tab or window
  43. }
  44. });
  45.  
  46. document.body.appendChild(link);
  47. };
  48.  
  49. if (window.location.href.startsWith('https://www.google.com/sorry')) {
  50. const query = extractQuery(window.location.href);
  51. searchButton(query, 'https://duckduckgo.com?q=', 'DuckDuckGo');
  52. searchButton(query, 'https://bing.com?q=', 'Bing');
  53. searchButton(query, 'https://search.brave.com/search?q=', 'Brave');
  54. searchButton(query, 'https://www.startpage.com/do/search?query=', 'Startpage');
  55. }
  56. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址