Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Add find.4chan search to every thread
- // @version 1.0
- // @include http*://boards.4chan.org/*
- // @include http*://boards.4channel.org/*
- // @grant GM_addStyle
- // ==/UserScript==
- document.getElementById("boardNavDesktopFoot").innerHTML += '<div id="search" style="float:right;display:inline;"> ' +
- '<form id="searchForm" target="_blank" action="https://find.4chan.org"> ' +
- '<input type="checkbox" id="nsfwBox" title="Search NSFW?" CHECKED> ' +
- '<input name="q" id="searchBox" type="text" value="" placeholder="Search 4chan!" /> ' +
- '<input type="submit" value="Search" /> ' +
- '</form> ' +
- '</div> ';
- var checkBox = document.getElementById("nsfwBox");
- checkBox.addEventListener('change', function() {
- if (this.checked) {
- document.getElementById("searchForm").setAttribute("action", "https://find.4chan.org");
- document.getElementById("searchBox").setAttribute("placeholder", "Search 4chan!");
- } else {
- document.getElementById("searchForm").setAttribute("action", "https://find.4channel.org");
- document.getElementById("searchBox").setAttribute("placeholder", "Search 4channel!");
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement