chrome-NewWindowWithTabsToRight icon indicating copy to clipboard operation
chrome-NewWindowWithTabsToRight copied to clipboard

Suspend/Unsuspend tabs (or maybe use Chrome's discard/autodiscard?)

Open 0xdevalias opened this issue 7 years ago • 2 comments

I have found The Great Suspender (Chrome Store, GitHub) to be a really useful extension for managing my 'sea of tabs', when I haven't yet got around to 'sleeping' them all.

It could be useful to be able to suspend/unsuspend tabs to the left/right/in this window/etc.

As per my ponderings in #6 (RE: implement new features vs tighter integration with other extensions), this is left open as a future potential pondering.

0xdevalias avatar Sep 04 '18 02:09 0xdevalias

APIs

  • https://developer.chrome.com/docs/extensions/reference/tabs/#method-discard
    • Discards a tab from memory. Discarded tabs are still visible on the tab strip and are reloaded when activated.

  • https://developer.chrome.com/docs/extensions/reference/tabs/#method-query
    • Gets all tabs that have the specified properties, or all tabs if no properties are specified.

      • autoDiscardable (boolean): Whether the tabs can be discarded automatically by the browser when resources are low.

      • discarded (boolean): Whether the tabs are discarded. A discarded tab is one whose content has been unloaded from memory, but is still visible in the tab strip. Its content is reloaded the next time it is activated.

  • https://developer.chrome.com/docs/extensions/reference/tabs/#method-update
    • Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified.

      • autoDiscardable (boolean): Whether the tab should be discarded automatically by the browser when resources are low.

  • https://developer.chrome.com/docs/extensions/reference/system_cpu/
    • Use the system.cpu API to query CPU metadata.

    • https://developer.chrome.com/docs/extensions/reference/system_cpu/#method-getInfo
      • Queries basic CPU information of the system.

      • https://developer.chrome.com/docs/extensions/reference/system_cpu/#type-CpuInfo
      • https://developer.chrome.com/docs/extensions/reference/system_cpu/#type-CpuTime
  • https://developer.chrome.com/docs/extensions/reference/system_memory/
    • The chrome.system.memory API.

    • https://developer.chrome.com/docs/extensions/reference/system_memory/#method-getInfo
      • Get physical memory information.

      • https://developer.chrome.com/docs/extensions/reference/system_memory/#type-MemoryInfo
  • https://developer.chrome.com/docs/extensions/reference/idle/
    • Use the chrome.idle API to detect when the machine's idle state changes.

    • https://developer.chrome.com/docs/extensions/reference/idle/#method-queryState
      • Returns "locked" if the system is locked, "idle" if the user has not generated any input for a specified number of seconds, or "active" otherwise.

    • https://developer.chrome.com/docs/extensions/reference/idle/#method-setDetectionInterval
      • Sets the interval, in seconds, used to determine when the system is in an idle state for onStateChanged events. The default interval is 60 seconds.

    • https://developer.chrome.com/docs/extensions/reference/idle/#event-onStateChanged
      • Fired when the system changes to an active, idle or locked state. The event fires with "locked" if the screen is locked or the screensaver activates, "idle" if the system is unlocked and the user has not generated any input for a specified number of seconds, and "active" when the user generates input on an idle system.

0xdevalias avatar Jan 23 '21 23:01 0xdevalias

It seems we can also manually play with discards/etc from chrome://discards/

0xdevalias avatar Jan 24 '21 03:01 0xdevalias