Giter Club home page Giter Club logo

Comments (8)

deanoemcke avatar deanoemcke commented on July 21, 2024 1

This issue is blocked as there is currently no way for me to perform any asynchronous cleanup job after the user chooses to uninstall (or disable) the extension.

Here is a chromium bug report requesting this be implemented:

One possible (very inadequate) fallback is to redirect the user to a url after uninstallation. This will not prevent users from losing their lost tabs, but it could at least take them to a page which could offer advice on how to recover the lost tabs.

from thegreatsuspender.

deanoemcke avatar deanoemcke commented on July 21, 2024

I agree this is a very unfortunate behaviour of the extension. However, due to the way that the tabs are suspended there is nothing I can do about it. The pages are unloaded by redirecting to a locally hosted webpage that is part of the extension. When the extension is uninstalled, the webpage that it refers to no longer exists, and so chrome removes that tab from the window.

The workaround is to 'unsuspend all tabs' before uninstalling. However, I appreciate not everyone will know to do this in advance.

from thegreatsuspender.

deanoemcke avatar deanoemcke commented on July 21, 2024

To investigate:

@ronin13 suggests that the chrome.runtime.onSuspend listener never gets called due to the extension using a persistent background page: #418

This is because the extension is not using event pages.

Hence,

//wishful thinking here that a synchronus iteration through tab views will enable them
//to unsuspend before the application closes
chrome.runtime.onSuspend.addListener(function () {
    chrome.extension.getViews({type: 'tab'}).forEach(function (view) {
        view.location.reload();
    });
});

in background.js never gets triggered.

It needs the background pages to be converted into event pages as described here: https://developer.chrome.com/extensions/event_pages

from thegreatsuspender.

meden avatar meden commented on July 21, 2024

Hello!

This issue is blocked as there is currently no way for me to perform any asynchronous cleanup job after the user chooses to uninstall (or disable) the extension.

Here are some chromium bug reports requesting this be implemented

The issue you're referring has been marked as fixed on Jul 15 2015...

Thanks for your work!

from thegreatsuspender.

fwextensions avatar fwextensions commented on July 21, 2024

Here's a thoroughly kludgy idea: on suspended.html, inject a hidden iframe pointing at a page on greatsuspender.github.io, which the extension has access to. Then inject a content script on that page with a dump of the currently suspended page data, which the script then writes to the local storage of the greatsuspender.github.io page.

When the extension is uninstalled, redirect to that page. It can then read its data from local storage and offer to reopen all the suspended, and now closed, pages. I'm betting Chrome would prevent a webpage from opening dozens of new tabs, so the user might have to manually click each one to reopen it. But better than losing it altogether.

This SO page suggests it might be possible: https://stackoverflow.com/questions/15288648/chrome-extension-write-to-local-storage-of-a-different-domain

But I go back to my suggestion in #688 of redirecting suspended pages to a web-served page instead of a local one, so that it's not closed on uninstall. Obviously doesn't help with the next update, but would with all future ones. May well be some impediment I haven't thought of, though.

from thegreatsuspender.

deanoemcke avatar deanoemcke commented on July 21, 2024

@meden i don't think it was marked as fixed? there was a resolution in the form of being able to specify an uninstall url which the user would get redirected to after uninstallation. however, this does not block the uninstallation process. it merely opens the requested url maybe before / maybe after the uninstall has taken place.

from thegreatsuspender.

deanoemcke avatar deanoemcke commented on July 21, 2024

@fwextensions thanks for the idea.
it may well work. i will do some investigation at some point. not for this upcoming release though :(

from thegreatsuspender.

meden avatar meden commented on July 21, 2024

@deanoemcke yes, you're right, the issue has been merged with a related, but different, one. Comment 12, though, mentions an event callback (although I imagine you already looked into it...)

from thegreatsuspender.

Related Issues (20)

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.