Advertisement
BarneyFag

Add find.4chan search bar to the bottom of every thread

Sep 30th, 2022 (edited)
1,562
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name     Add find.4chan search to every thread
  3. // @version  1.0
  4. // @include  http*://boards.4chan.org/*
  5. // @include  http*://boards.4channel.org/*
  6. // @grant    GM_addStyle
  7. // ==/UserScript==
  8. document.getElementById("boardNavDesktopFoot").innerHTML += '<div id="search" style="float:right;display:inline;"> ' +
  9.     '<form id="searchForm" target="_blank" action="https://find.4chan.org"> ' +
  10.       '<input type="checkbox" id="nsfwBox" title="Search NSFW?" CHECKED> ' +
  11.     '<input name="q" id="searchBox" type="text" value="" placeholder="Search 4chan!" /> ' +
  12.     '<input type="submit" value="Search" /> ' +
  13.     '</form> ' +
  14.     '</div> ';
  15.  
  16. var checkBox = document.getElementById("nsfwBox");
  17. checkBox.addEventListener('change', function() {
  18.   if (this.checked) {
  19.     document.getElementById("searchForm").setAttribute("action", "https://find.4chan.org");
  20.     document.getElementById("searchBox").setAttribute("placeholder", "Search 4chan!");
  21.   } else {
  22.     document.getElementById("searchForm").setAttribute("action", "https://find.4channel.org");
  23.     document.getElementById("searchBox").setAttribute("placeholder", "Search 4channel!");
  24.   }
  25. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement