Suspender

Dedicated board for extension releases/support threads

Moderators: FranklinDM, Lootyhoof

Forum rules
Please do not create new topics here unless you are an extension author in need of a dedicated releases&support thread!
User avatar
jars_
Lunatic
Lunatic
Posts: 399
Joined: 2016-12-27, 00:12

Re: Suspender

Unread post by jars_ » 2021-05-29, 08:40

Can you make a menuitem(function) "Unload Host(domain) tabs" ?
I made this function\menuitem on CustomButtons. I would like this function in extension.
Я сделал у себя на CustomButtons для этого кнопку. Хотелось бы, чтоб такая функция была в расширении.
The CButton:

Code: Select all

.....
... ↑ code for menuitem and others ↑

//  Закрыть или выгрузить другие вкладки этого домена (нужно расширение  BarTab или LullTheTabs или Suspender)
//  gBrowser.LullTheTabs.unloadTab(tab);  gBrowser.BarTabHandler.unloadTab(tab);    getBrowser().reloadTab(tab);
 this.closeHost = function(act) {
  let allTabs = Array.from(gBrowser.tabs), clickTabDom = getDomain(gBrowser.mContextTab.linkedBrowser.currentURI.spec), closeTabs = [];
    closeTabs = allTabs.filter(tab => {
         let ctd = getDomain(tab.linkedBrowser.currentURI.spec);
           if( !tab.pinned && tab !== gBrowser.selectedTab && clickTabDom == ctd ) return tab;
           //console.log( "clickTabDom = " + clickTabDom + " \| ctd = "+ ctd);
         });

   closeTabs.forEach( (tab)=> {
      switch(act) {
          case "close": gBrowser.removeTab(tab); break;
          case "unload": gBrowser.Suspender.unloadTab(tab);   break; 
          default: return;
        }
    });
     
 };

  function getDomain(url) {
   let dom = (url.toString().startsWith("http")) ? Services.eTLD.getBaseDomain(Services.io.newURI(url, null, null)) : false;
   return dom;
   };

New Tobin Paradigm

Re: Suspender

Unread post by New Tobin Paradigm » 2021-05-29, 11:11

You obviously know a dash of JS.. So why don't you grab the repo, add it, and submit a PR to help out?

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35650
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Suspender

Unread post by Moonchild » 2023-07-26, 23:01

Moved to extension releases board ;)
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite