jQuery everywhere

injects jquery if not exists

当前为 2022-01-23 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name jQuery everywhere
  3. // @namespace https://greasyfork.org/en/users/12725-alistair1231
  4. // @version 0.1
  5. // @description injects jquery if not exists
  6. // @author Alistair1231
  7. // @match *://*/*
  8. // @grant none
  9. // @license GPL-3.0
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. if(typeof jQuery=='undefined') {
  15. var jq = document.createElement('script');
  16. jq.src = "https://code.jquery.com/jquery-3.6.0.min.js";
  17. document.getElementsByTagName('head')[0].appendChild(jq);
  18.  
  19. // ... You might need to also run
  20. jQuery.noConflict();}
  21. })();