Libs for every page

make jquery can be used in every page

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