GithubHelp home page GithubHelp logo

rneomy / auto-tab-discard Goto Github PK

View Code? Open in Web Editor NEW
861.0 21.0 75.0 572 KB

Use native tab discarding method to automatically reduce memory usage of inactive tabs

Home Page: https://webextension.org/listing/tab-discard.html

License: Mozilla Public License 2.0

JavaScript 76.36% HTML 18.71% CSS 4.93%
chrome-extension firefox-addon browser-extension chrome firefox-extension

auto-tab-discard's People

Contributors

antonindelfabbro avatar cliffordp avatar haiwx avatar lej77 avatar no1xsyzy avatar piroor avatar sfleiter avatar tonycpsu avatar toto6038 avatar vistaus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

auto-tab-discard's Issues

does not discard youtube tabs

image

addons installed: umatrix ublock
settings altered: media.autoplay.enabled=false
youtube tab does not begin playing (because above setting)

i switch to another tab then right click on youtube tab - force discard - no effect (still see it on about:performance, i see it open when i click it)

[Feature request] Blacklist instead of whitelist options

Currently, the entire set of options in this extension are what I would describe as "whitelist-oriented". What I mean by this is, the extension is designed so that you can:

  • auto-discard all tabs
  • set some options to whitelist some tabs so they are not discarded (e.g. set domain "Exceptions" or avoid discarding tabs opened less than 600 seconds ago, or avoid discarding pinned tabs)

What would be very nice is the opposite of this:

  • don't auto-discard any tabs
  • set some options to always auto-discard some very resource-intensive domains after a set period of inactivity

Favicons

I noticed that discarding tabs most of the time makes it loose it's favicon. Is that expected behavior? Could that be fixed? Thank you.

[Feature request] Missing functionalities from tab suspender

On tab suspender, there was an option in context menu to have access to suspend tabs actions. I miss it in auto tab discard :(
An other option I liked was the option to display placeholder page, which needed a click to reload the tab. I usually have a lot of tab, and navigate through them using ctrl+tab. With tab suspender, suspended tabs were not reloaded, and now with auto tab discard they are, which is pretty annoying for me.

Is there a way to implement these features ?
Thanks

Support for Opera

Hello,

Is there any chance of getting support for Opera with this extension? I've used your Tab Suspender extension in Opera for awhile, and it has worked nicely, but I would vastly prefer the native solution using Chromium's discard API. I tried installing it from the Chrome Web Store thinking that since Opera was a Chromium-based browser that it would work, but it didn't.

Thanks!

Use regexp for url in exception list

Could you please ,
make the exception list able to use the regular expression for specific URL ?
If no ,
make the exception list able to use the wildcard character for specific URL ?

Shortcut keys

Could you add a keyboard shortcut (configurable) for the common commands? Like ctrl+something?

Also could shift+click on the tab in the tabbar suspend the tab?

some tabs are not restored

I've been using this extension since yesterday with Firefox Developer Edition, and I've noticed that sometimes some tabs fail to restore - they are empty, completely blank, with nothing in the address bar and only with a title on the tab. It happened to me at least 3 times already.

[Feature Request] - Only reload on page "click" - not Tab focus

I routinely have 20-100 tabs open (using tree style tabs over multiple virtual screens), and when going through doing "mass closings", the tab focus often changes to a tab I don't necessarily want to reload, but instead plan on closing. This results in slowing down firefox as I do lots of reloads, before I can close them.

I previously used "the great extender" in chrome, which would display a (poor, but good enough) screenshot of the page, and only reload if I clicked the screenshot. this was MUCH less resource intensive than doing a reload of the tab any time I accidentally made it active.

Thanks!

Private mode incorrect behavior (FF59.0b7)

It discards private session tabs in a way that you cant refresh them afterwards:
There is empty box instead of page address, reload button is not active.
Could you add option to disable this add-on for private session? FF has API to determine current mode for that.

Discarding and reloading a tab twice breaks "Ctrl-F".

Firefox Dev 59.0b3 (64-bit) on Windows 10 64
Extension 0.1.3

  • Go to Facebook.com.
  • (Begin loop)
  • Click to another tab.
  • Right-click toolbar icon, "Discard all inactive tabs".
  • Click on Facebook tab.
  • Loop twice if necessary.
    Now Ctrl-F doesn't work anymore.

This happens after discarding and reloading Youtube, htmledit.squarefree.com, xkcd.com, or asdf.com twice.

I have reproduced on a clean profile on https://www.mozilla.org/en-US/privacy/firefox/.

Settings Exception Whitelist doesn't work when entries are seperated with a line break

It looks like the exceptions whitelist in the settings only works when multiple entries are seperated with a comma. The text field is a multi-line one though, giving the impression that I can put in one entry per line. I tried that and the whitelist feature stopped working. Please either explain this in the UI and make the text field single line or make it so that line breaks also work.

Thanks

FF58.0 \ v0.1.3: Incompatibilty with LastPass addon

As mentioned in #3, I couldn't get Auto Tab Discard to work at all with my main Firefox profile with a total of 28 addons.

I spent time disabling all of my addons and slowly re-enabled them till it stopped working. At the end of the day, the conflicting addon was LastPass v4.2.3.20 & v4.2.4a (https://addons.mozilla.org/en-US/firefox/addon/lastpass-password-manager/). [I do have the binary component installed as well - https://lastpass.com/download/cdn/lastpass_x64.exe]

When LastPass is enabled, I could not get Auto Tab Discard to work at all. When disabled (27 other addons enabled), I replicated the behavior described in #3.

Suggestion: allow discarding a specific tab (ignoring whitelist)

Basically, it'd be nice to force-discard a particular tab (e.g. Pandora) even when it's whitelisted. In case you're wondering, I made extensive use of The Great Suspender, which had an option to suspend the current tab without regard to the whitelist. (Another benefit it had was maintaining suspension after browser close/reopen, but that's not something I feel is an absolute must, as I hardly used it save for keeping open a largish PDF file that I wasn't actively reading until later.)

TST compatibility

For some reason, sometimes auto-tab-discard disappears from the TST-tabs RMB context menu.
The workaround is to disable and re-enable auto-tab-discard in about:addons and then restart FF.

Addon no longer works

Since upgrading to FF 60.0b7 this addon stopped working. Tabs are no longer unloaded after the set amount of time.

Blacklist feature doesn't work

Firstly, thank you so much for taking on my feature request in #36; it's really encouraging to see such a prompt and open response.

However, sadly, after upgrading, it doesn't seem to work ๐Ÿ˜•

I've tried the following quick test:

screen shot 2018-05-23 at 13 32 04

and also tried the same with various variations on the above like:

re:slack
slack.com
myorganisation.slack.com

All of the above tests just result in every single tab being auto-discarded.

[Feature Request] Icon Losses in new FF Versions, this work-around should work.

In newer versions of Firefox, Tab's Lose Icon's upon Browser Reload.
I think this can be fixed via an Work-around.

If the Addon manually opens (Or allows browser to background open) an initial blank page handled by the Addon knowing the season has changed and the tab is in the background and thus opens blank page except specifying the icon from a file:// Cached Copy and then Discarding the Tab waiting for the user to reactivate the tab at which point it'll open the Source URL as expected.

TST detect unload

Platform (OS): Win 10 (x64)
Version of Firefox: 59.0b12 (x64)
Version of auto-tab-discard: 0.1.8
Version of Tree Style Tab: 2.4.16

The treestyletab addon has a useful "code snippets" function - for custom rules of a tabs style .
In my opinion, the most useful function here - the marking of unloaded tabs with gray shading:
https://github.com/piroor/treestyletab/wiki/Code-snippets-for-custom-style-rules#change-styling-of-pending-unloaded-tabs-1363
Is it possible to add support for this thing, so that TST could detect tab unloading?
Or, it would be more correct to make changes on the TST side?

Quicker commands

Could you add to tab and/or page context the "whitelist this page" and "whitelist this domain" to quickly add pages to the whitelist please and also include the unload this tab/other tabs to the context menus as well? Thank you.

Tabs not discarded when e10s is disabled

Thanks for writing this important addon!

I'm encountering an issue where tabs are not discarded when e10s is disabled. You can disable e10s by setting browser.tabs.remote.autostart and browser.tabs.remote.autostart.2 to false in about:config.

Hopefully, it is an easy fix, but I understand if it isn't.

Here's the debug log:

[Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIMessageSender.sendAsyncMessage]"  nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)"  location: "JS frame :: resource://gre/modules/ExtensionUtils.jsm :: sendAsyncMessage :: line 533"  data: no]  (unknown)
Unchecked lastError value: Error: Could not establish connection. Receiving end does not exist.  menu.js:162
Unchecked lastError value: Error: Script '<anonymous code>' result is non-structured-clonable data  background.js:105

Update - Looks like Firefox devs says the discard API only works for e10s:
https://bugzilla.mozilla.org/show_bug.cgi?id=1442924

Offer shorter browser action tooltip

Currently, the Auto Tab Discard browser action uses the text "Left-click to open options. Right-click to discard." as its tooltip. However, when I move it into the overflow panel, that gets used as the entry title, making for an unacceptably long entry which ballons up my overflow popup.

screenshot2

Given that Firefox no longer has an Addons toolbar I can enable along the bottom of the window, that's the only place I'm willing to put the browser action.

(And, with the browser action removed entirely and the default tab bar hidden via userChrome.css to make the best use of Tree Style Tab (Issue #11), that leaves me without a way to manually trigger Auto Tab Discard.)

Please consider offering some kind of preferences entry to switch the browser action title to something more fitting for being in the overflow menu.

(Also, sorry for e-mailing you about this first. Initially, I didn't notice the "If you have questions about the extension, or ideas on how to improve it, please post them on the support site." among everything else on your site. You might want to update the "Support Site" link on the addons.mozilla.org page to point directly here.)

[Feature Request] left click = discard this tab (forced)

Your plugin is downright awesome when it comes to simplicity and everything works the way it should (almost all ๐Ÿ˜œ)
So my problem or perhaps the biggest request for improvement is instead of the addon taking you to your project page it should have a default behaviours for left click like discard this tab (cause i use it the most).
Just 1 left click to discard tabs would be cool af ๐Ÿ˜Ž

Tab's icon lose

Version 0.1.8
FF Quantum 59.0b14
When reopen FF some tabs lose their icons and needs to load discarded tab to load icon.

Conflict with tab focus addons

Great addon for Firefox Quantum!

One thing I'm finding is a conflict with using tab focus addons like "Tab Deque" or "Tab Open/Close Control".

Tab Deque is an addon that helps to give focus to the last active, selected tab when you close a tab. When this happens, Tab Deque looks like it gives focus to an adjacent tab before allowing to focus on the last active tab.

For Auto Tab Discard, if the adjacent tab was discarded since Tab Deque will give focus, the tab will now be undiscarded before focusing on the last active tab.

I know this probably isn't a problem with Auto Tab Discard, but thought I would note this. Appears to be a problem with all tab focus addons, so I'm guessing this is a Firefox tab API limitation at the moment.

[Bug Fix] The Auto Tab Discard's "popup" is unreadable when using a dark GTK Theme on Linux - Here how to fix it

Hi,

I am using a Dark GTK Theme on Linux with Firefox. And sadly, it is quite difficult to use this plugin since the background color of the popup is almost black with this setup.

After seeing the data/popup/index.html, line 9, I would assume you just need to add the following css property:

body
{
    background-color: #FFFFFF !important;
    [...]
}

Sadly, I did not directly tested that since it became harder to modify an extension on Firefox (lack of time mostly). However I modified my userContent.css in the profile folder of Firefox: ~/.mozilla/firefox/XXXXXXXXXX.default/chrome, and it works:

@-moz-document url("moz-extension://[...extension-hash...]/data/popup/index.html")
{
    body
    {
        background-color: #FFFFFF !important;
    }
}

Thank you for your great add-on!

Best regards,

Issues with FF58.0 release build \ some tabs work, others don't (v0.1.3)

Using the soon to be pushed FF58.0 (http://ftp.mozilla.org/pub/firefox/releases/58.0/win64/en-US/):

This could certainly be related to this build of FF58 as there is obviously been better behavior with older beta builds and with the newer FF59b2. (Actually with my main machine upgraded to this FF58, I can't get it to work at all but I still have some investigation to do there)

[Question] Updating discarded tab title.

I have wrote a small extension for numbering the tabs and it works fine. However when using with your add on, I notice the title on discarded tabs are not updated at all.

Do you aware why this is the case? Thank you.

Below is the code, it is based on the tab numbering extension but modified for my specific use case.

const browser = window.browser || window.chrome

var update = function(details) {
  var oldTitle = details.title
  var newTitle = oldTitle

  if(!newTitle) {
    return
  }

  var numbers = ['1. ','2. ','3. ','4. ','5. ','6. ','7. ','8. ','9. ','10. ','11. ','12. ','13. ','14. ','15. ','16. ','17. ','18. ','19. ','20. ','21. ','22. ','23. ','24. ','25. ','26. ','27. ','28. ','29. ','30. ']

  if (newTitle) {
    if (numbers.includes(newTitle.substr(0,3)))
      newTitle = newTitle.substr(3)
    else if (numbers.includes(newTitle.substr(0,4)))
      newTitle = newTitle.substr(4)
  }

  if(details.index < 31 && !newTitle.startsWith(numbers[details.index])) {
    newTitle = numbers[details.index] + newTitle
  }
  if(oldTitle !== newTitle) {
    try {
      browser.tabs.executeScript(
        details.id,
        {
          code : `document.title = ${JSON.stringify(newTitle)}`
        }
      )
      console.log("executed: " + details.id)
    } catch(e) {
      console.log("Tab numbering error:", e)
    }
  }
}

function updateAll() {
  browser.tabs.query({}, function(tabs) {
    tabs.forEach(update)
  })
}

browser.tabs.onMoved.addListener(updateAll)
browser.tabs.onCreated.addListener(updateAll)
browser.tabs.onAttached.addListener(updateAll)
browser.tabs.onDetached.addListener(updateAll)
browser.tabs.onDetached.addListener(updateAll)


// firefox seems to do this inconsistently, thus this setTimeout kludge:
browser.tabs.onRemoved.addListener(() => {
  updateAll()
  setTimeout(updateAll, 100)
  setTimeout(updateAll, 500)
  setTimeout(updateAll, 1000)
})
browser.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
  update(tab)
})

updateAll()

Opening multiple tabs

When I'm restoring multiple tabs from bookmarks and using the option for 6 active tabs only, they still load. How can I prevent this?

TST - Do not discard this domain

Looks like RMB context menu "Do not discard this domain" also do not work with TST.
List of exceptions in the settings - works properly.

Only Pin Tabs are discarded

On my Firefox 58.0 - 64 bit on W10 the extension works only on pin tabs, the normal tabs remain untouched.
The problem is present also manually by the context menu.
In the browser console I have this error:
[Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIMessageSender.sendAsyncMessage]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: resource://gre/modules/ExtensionUtils.jsm :: sendAsyncMessage :: line 514" data: no] (unknown)
Error: Could not establish connection. Receiving end does not exist. undefined

Media playing

The addon seems to not notice when media is playing or not. It does not unload the tab is there is a video even if the video was never played like for example in youtube.

[Feature request] Save time of media pages

First off; great plugin!

When pausing ie. a Youtube-video the tab sometimes gets discarded as it should, but when reactivating the tab, it would be nice to start the video from the time it was paused, and not a fresh reload of the page.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.