Feedly - Open in Background Tab

Open the selected link in another tab

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Feedly - Open in Background Tab
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  Open the selected link in another tab
// @author       JackNUMBER
// @match        *://*.feedly.com/*
// @grant        GM_openInTab
// ==/UserScript==
// Based on Aaron Saray's code, with the fix by henley-regatta: https://github.com/aaronsaray/feedlybackgroundtab/blob/2e828c763f9002d04ea9b1f7fdf79f864d86e7ef/src/js/keypress.js

// code '59' is ';'
const _triggerKeyCode = 59;

(function() {
  'use strict';
/*
  const selectors = [
    '.list-entries .entry--selected a.entry__title', // Additional selector for recent Feedly changes
    'div.selectedEntry a.title',                     // title bar for active entry, collapsed or expanded
    '.selectedEntry a.visitWebsiteButton',           // the button square button on list view
    '.list-entries .inlineFrame--selected a.visitWebsiteButton', // the button square button on list view
    'a.visitWebsiteButton',   				        // the floating one for card view
    '.entry.selected a.title'                       // title bar for active entry in React-based collapsed list view
  ];
*/
  const selectors = [
    '.TitleOnlyLayout--selected a.EntryTitleLink--selected', // title bar for active entry, collapsed (2024-05-01)
    'a.visitWebsiteButton'                                   // the floating one for card view
  ];
  /**
  * Main feedlybackgroundtab constructor
  */
  const FBT = function() {

    /**
    * handler for key press - must be not in textarea or input and must be not altered
    * Then it sends extension request
    * @param e
    */
    this.keyPressHandler = function(e) {
      const tag = e.target.tagName.toLowerCase();
      console.log('tag', e.target);
      if (tag != 'input' && tag != 'textarea') {
        if ((!e.altKey && !e.ctrlKey) && e.keyCode == _triggerKeyCode) {
          let url;
          for (var x in selectors) {
            url = document.querySelector(selectors[x]);
            console.log(url);
            if (url) {
              break;
            }
          }
          if (url) {
            GM_openInTab(url.href);
          } else {
            console.log("Could not find any selectors from: " + selectors.join());
          }
        }
      }
    }
  };

  if (window == top) {
    const fbt = new FBT();
    window.addEventListener('keypress', fbt.keyPressHandler, false);
  }
})();