open in new tab jjj66

force auto open in new tab

  1. // ==UserScript==
  2. // @name open in new tab jjj66
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.3
  5. // @description force auto open in new tab
  6. // @author You
  7. // @match https://m.youtube.com/*
  8. // @exclude https://m.youtube.com/watch*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
  10. // @grant none
  11. // @require http://code.jquery.com/jquery-latest.js
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. // Your code here...\
  18. $(document).ready(
  19. function() {
  20.  
  21.  
  22. window.setTimeout(function(){
  23. $("a").each(function() { $(this).attr('target','_blank') });
  24. }, 500);
  25.  
  26.  
  27. $("html").bind("DOMNodeInserted",function(){
  28. $("a").each(function() { $(this).attr('target','_blank') });
  29. });
  30.  
  31.  
  32. }
  33. );
  34. })();