Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- external-text:" #? ","javascript:
- (function(){
- var posts = Array.from(document.querySelectorAll('.post.reply[id]'));
- var i = 0;
- var selected = posts[0];
- var current = location.hash.substr(1);
- if (posts.length > 0) {
- if (posts.length > 1) {
- do {
- i = Math.floor(Math.random()*posts.length);
- selected = posts[i];
- posts.splice(i, 1);
- } while(posts.length > 0 && (!selected.offsetParent || !/^p\d+$/.test(selected.id) || selected.id === current));
- }
- if (selected.offsetParent && /^p\d+$/.test(selected.id)) {
- location.href = '#'+ selected.id;
- }
- }
- }())
- "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement