No Redirect to Bing CN for Chrome NTP

当 Chrome 的搜索引擎设置为 Bing 时阻止新标签页重定向到 Bing 中国首页

  1. // ==UserScript==
  2. // @name No Redirect to Bing CN for Chrome NTP
  3. // @namespace xuyiming.open@outlook.com
  4. // @description 当 Chrome 的搜索引擎设置为 Bing 时阻止新标签页重定向到 Bing 中国首页
  5. // @author 依然独特
  6. // @version 1.0
  7. // @grant unsafeWindow
  8. // @run-at document-start
  9. // @include https://cn.bing.com/chrome/newtab
  10. // @match https://cn.bing.com/chrome/newtab
  11. // @license BSD 3-Clause
  12. // ==/UserScript==
  13.  
  14. "use strict";
  15.  
  16. /**
  17. * @see {@link https://www.chromium.org/embeddedsearch}
  18. */
  19.  
  20. if (unsafeWindow.chrome != null) {
  21. // unsafeWindow.chrome.embeddedSearch ??= {
  22. // newTabPage: {
  23. // mostVisited: [],
  24.  
  25. // get onmostvisitedchange() {
  26. // return null;
  27. // },
  28.  
  29. // set onmostvisitedchange(_) {},
  30.  
  31. // deleteMostVisitedItem(_) {},
  32.  
  33. // undoMostVisitedDeletion(_) {},
  34.  
  35. // undoAllMostVisitedDeletions() {}
  36.  
  37. // }
  38. // };
  39.  
  40. var _unsafeWindow$chrome, _unsafeWindow$chrome$;
  41.  
  42. (_unsafeWindow$chrome$ = (_unsafeWindow$chrome = unsafeWindow.chrome).embeddedSearch) !== null && _unsafeWindow$chrome$ !== void 0 ? _unsafeWindow$chrome$ : _unsafeWindow$chrome.embeddedSearch = {
  43. newTabPage: {
  44. mostVisited: [],
  45.  
  46. get onmostvisitedchange() {
  47. return null;
  48. },
  49.  
  50. set onmostvisitedchange(_) {},
  51.  
  52. deleteMostVisitedItem: function deleteMostVisitedItem(_) {},
  53. undoMostVisitedDeletion: function undoMostVisitedDeletion(_) {},
  54. undoAllMostVisitedDeletions: function undoAllMostVisitedDeletions() {}
  55. }
  56. };
  57. }