InoReader - Fix Open Article in Background Tab

Fixes InoReader's keyboard shortcut to open articles in background tabs in Firefox

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

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 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        InoReader - Fix Open Article in Background Tab
// @namespace   https://greasyfork.org/en/users/13300-littlepluto
// @description Fixes InoReader's keyboard shortcut to open articles in background tabs in Firefox
// @match       http://www.inoreader.com/*
// @version     1.1
// @grant       GM_openInTab
// ==/UserScript==
var element = document.createElement('div');
element.id = 'inoreader_companion_div';
document.body.appendChild(element);
window.addEventListener('message', receiveMessage);
function receiveMessage(event) {
  //console.log("receiveMessage event: ");
  //console.log(event);
  if (event.origin == 'http://www.inoreader.com') {
    if (event.data.request && event.data.request.url) {
      //console.log(event.data.request.url);
      GM_openInTab(event.data.request.url, true);
    }
  }
}