Libs for every page

make jquery can be used in every page

目前为 2016-01-01 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Libs for every page
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2.1
  5. // @description make jquery can be used in every page
  6. // @author cbj
  7. // @include *
  8. // @match https://greasyfork.org/en/scripts
  9. // ==/UserScript==
  10. /* jshint -W097 */
  11. 'use strict';
  12.  
  13. // Your code here...
  14. window.addEventListener('load', function() {
  15. if(!unsafeWindow.jQuery){
  16. var script = document.createElement('script');
  17. script.src = 'https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js'
  18. document.body.appendChild(script);
  19. }
  20. });