InoReader - Open Article in Background Tab

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

目前為 2014-06-14 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name InoReader - Open Article in Background Tab
  3. // @author Rameez Khan
  4. // @namespace plus.google.com/+RameezKhanSA
  5. // @description Fixes Firefox functionality to allow for opening of background tabs in InoReader
  6. // @include http://www.inoreader.com/
  7. // @grant GM_openInTab
  8. // @version 1.0.0
  9. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js
  10. // ==/UserScript==
  11.  
  12. /*
  13. Author: Rameez Khan (plus.google.com/+RameezKhanSA)
  14. Changelist:
  15. 1 : Initial workings
  16. A special thanks to Lyk for pushing me in the right direction with his userscript for feedly (userscripts.org/users/Lyk)
  17. */
  18.  
  19. jQuery.noConflict();
  20.  
  21. (function() {
  22. var background_key = 59;
  23. /* 72 is for the ';'-key
  24. ** pick the corresponding number from here: http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes
  25. */
  26.  
  27. jQuery(document).keydown(function(e) {
  28. if ( e.which == background_key && !(e.altKey || e.ctrlKey || e.metaKey) ) {
  29. var el = document.activeElement;
  30. // if in textfield, do nothing
  31. if (el && (el.tagName.toLowerCase() == 'input' && el.type == 'text' ||
  32. el.tagName.toLowerCase() == 'textarea')) {
  33. return true;
  34. }
  35. // alert("pressed!");
  36. var activeElem = jQuery('div#reader_pane');
  37. // console.log(activeElem);
  38. var articleKids = activeElem.children('div.article_current').children('div.article_full_contents').children('div.article_title').children('a.article_title_link');
  39. // console.log(articleKids.attr('href'));
  40. GM_openInTab(articleKids.attr('href'), true);
  41. return true; // To supress default behavior of the event
  42. // Added for those who have "search as I type" features enabled, etc
  43. }
  44. });
  45. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址