Hacker News Search

Adds a simple search box to the top bar of the Hacker News site.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Hacker News Search
// @namespace    http://www.ryangittins.com/
// @author       Ryan Gittins
// @version      1.0.3
// @description  Adds a simple search box to the top bar of the Hacker News site.
// @match        *://news.ycombinator.com/*
// @copyright    2014
// @grant        none
// ==/UserScript==

// Grab the top bar
var selector = document.querySelector('td > table > tbody > tr');

// Insert a new td between the submit link and the login link
var cell = selector.insertCell(2);

// Inject the search box html into the header
cell.innerHTML = '<span><form method="get" action="//hn.algolia.com/" style="margin:0;"><input style="height:20px;" type="text" name="q" size="16" placeholder="Search"></form></span>';