Google machine-learning course helper

将谷歌机器学习教程的wiki英文链接改成中文链接,点击链接将在新标签页中打开,同时点击右上角的wiki图标可在新标签页中打开原wiki英文链接

  1. // ==UserScript==
  2. // @name Google machine-learning course helper
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description 将谷歌机器学习教程的wiki英文链接改成中文链接,点击链接将在新标签页中打开,同时点击右上角的wiki图标可在新标签页中打开原wiki英文链接
  6. // @author You
  7. // @match https://developers.google.cn/machine-learning/crash-course/prereqs-and-prework
  8. // @grant none
  9. // @require http://code.jquery.com/jquery-1.11.0.min.js
  10. // ==/UserScript==
  11.  
  12. this.$ = this.jQuery = jQuery.noConflict(true);
  13.  
  14. (function() {
  15. 'use strict';
  16. // Your code here...
  17. $('a[href]').each(function(){
  18. let href=$(this).attr('href');
  19. if(href&&href.indexOf('https://wikipedia.org/wiki/')==0){
  20. $(this).attr('href','https://zh.wikipedia.org/wiki/'+$(this).html());
  21. $(this).attr('target','_blank');
  22. $(this).after('<a target="_blank" href="'+href+'"><img src="https://en.wikipedia.org/static/favicon/wikipedia.ico" width="12px" height="12px" style="vertical-align:top"/></a>');
  23. }
  24. });
  25. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址