InoReader - Open Article in Background Tab

Fixes Firefox functionality to allow for opening of background tabs in InoReader

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name        InoReader - Open Article in Background Tab
// @author      Rameez Khan
// @namespace   plus.google.com/+RameezKhanSA
// @description Fixes Firefox functionality to allow for opening of background tabs in InoReader
// @include     http://www.inoreader.com/
// @grant          GM_openInTab
// @version        1.0.0
// @require        http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js
// ==/UserScript==

/* 
    Author:  Rameez Khan (plus.google.com/+RameezKhanSA)
    
    Changelist:
       1 : Initial workings
    
    A special thanks to Lyk for pushing me in the right direction with his userscript for feedly (userscripts.org/users/Lyk)
*/

jQuery.noConflict();

(function() {
	var background_key = 59;
		/* 72 is for the ';'-key
		** pick the corresponding number from here: http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes
		*/

	
	jQuery(document).keydown(function(e) {
		if ( e.which == background_key && !(e.altKey || e.ctrlKey || e.metaKey) ) {
			var el = document.activeElement;
    
			// if in textfield, do nothing
			if (el && (el.tagName.toLowerCase() == 'input' && el.type == 'text' ||
					el.tagName.toLowerCase() == 'textarea')) {
				return true;  
			}
            
//             alert("pressed!");
            var activeElem = jQuery('div#reader_pane');
//             console.log(activeElem);
            
            var articleKids = activeElem.children('div.article_current').children('div.article_full_contents').children('div.article_title').children('a.article_title_link');
//             console.log(articleKids.attr('href'));
            GM_openInTab(articleKids.attr('href'), true);
            
			return true; // To supress default behavior of the event
			// Added for those who have "search as I type" features enabled, etc
		}
	});
})();