有道翻译HTTPS

使有道翻译在HTTPS下正常运作

  1. // ==UserScript==
  2. // @name 有道翻译HTTPS
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description 使有道翻译在HTTPS下正常运作
  6. // @author mom0a
  7. // @match https://fanyi.youdao.com
  8. // @require https://code.jquery.com/jquery-latest.js
  9. // @namespace https://greasyfork.org/
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. $('link').each(function(){
  16. $(this).attr('href',$(this).attr('href').replace(/http\:\/\//i,'https://'));
  17. });
  18. $('script').each(function(){
  19. if($(this).attr('src')){
  20. $('body').append('<script src="'+$(this).attr('src').replace(/http\:\/\//i,'https://')+'"></script>')
  21. }
  22. });
  23. })();