替换全角!到半角!

替换全角bang!到半角bang!

当前为 2019-01-09 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name    Replace Full width bang to half width
  3. // @name:zh-CN  替换全角!到半角!
  4. // @namespace https://github.com/fengkx/
  5. // @match https://duckduckgo.com/*
  6. // @match https://start.duckduckgo.com/*
  7. // @version 0.1
  8. // @description Replace Full width bang! to half width!
  9. // @description:en Replace Full width bang! to half width!
  10. // @description:zh 替换全角bang!到半角bang!
  11. // @description:zh-CN 替换全角bang!到半角bang!
  12. // @grant none
  13. //@run-at document-end
  14. // ==/UserScript==
  15.  
  16. var $input = document.getElementById('search_form_input_homepage') || document.getElementById('search_form_input') ;
  17. $input && $input.addEventListener('input', function (e) {
  18. this.value = this.value.replace(/^!/, '!');
  19. })