Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name /qa/ on the frame navigation!
- // @namespace http://www.4chan.org/
- // @version 1023
- // @description Adds /qa/ to 4chan's frames
- // @author (You)
- // @match http://www.4chan.org/frames_navigation
- // @match https://www.4chan.org/frames_navigation
- // @match http://www.4channel.org/frames_navigation
- // @match https://www.4channel.org/frames_navigation
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- let board_title = 'Question & Answer';
- let full_taste = location.hostname.endsWith('4chan.org');
- // roll for perception check!
- let i = document.querySelector('a[href$="/qst/"]');
- if (i === null) {
- // critical failure
- console.error('Could not find insertion point');
- return;
- }
- let qa_link = document.createElement('a');
- qa_link.setAttribute('href', '//boards.' + (full_taste ? '4chan' : '4channel') + '.org/qa/');
- qa_link.setAttribute('target', 'main');
- qa_link.setAttribute('title', board_title);
- qa_link.appendChild(document.createTextNode(board_title));
- let qa_entry = document.createElement('li');
- qa_entry.appendChild(qa_link);
- let insertion_anchor = i.parentNode;
- insertion_anchor.parentNode.insertBefore(qa_entry, insertion_anchor);
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement