lg144ds
May 15th, 2023
24
0
Never
This is comment for paste // ==UserScript== // @name 2ch pa...
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name       2ch pastebin
  3. // @version    0.2.2
  4. // @match      https://2ch.hk/*
  5. // ==/UserScript==
  6.  
  7. $('.posts').bind('DOMSubtreeModified', function() {
  8.   $('a[href^="http://pastebin.com/"]').each(function() {
  9.     var id = this.href.match(/pastebin\.com\/(\w+)/)[1];
  10.  
  11.     if (!id || $(this).next().is('.pastebin')) return;
  12.  
  13.     $('<div>', {
  14.       class: 'pastebin',
  15.       html: $('<iframe>', {
  16.         src: 'https://pastebin.com/embed_iframe.php?i=' + id,
  17.         style: 'border:none; width:800px; height:500px'
  18.       })
  19.     }).insertAfter(this);
  20.   });
  21. });
Add Comment
Please, Sign In to add comment