Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name 2ch pastebin
- // @version 0.2.2
- // @match https://2ch.hk/*
- // ==/UserScript==
- $('.posts').bind('DOMSubtreeModified', function() {
- $('a[href^="http://pastebin.com/"]').each(function() {
- var id = this.href.match(/pastebin\.com\/(\w+)/)[1];
- if (!id || $(this).next().is('.pastebin')) return;
- $('<div>', {
- class: 'pastebin',
- html: $('<iframe>', {
- src: 'https://pastebin.com/embed_iframe.php?i=' + id,
- style: 'border:none; width:800px; height:500px'
- })
- }).insertAfter(this);
- });
- });
Advertisement