Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto save on tab removal #1457

Open
sanjeevApple opened this issue May 14, 2024 · 2 comments
Open

Auto save on tab removal #1457

sanjeevApple opened this issue May 14, 2024 · 2 comments

Comments

@sanjeevApple
Copy link

For questions, please create or update a thread here:
https://github.com/gildas-lormeau/SingleFile/discussions

Please ensure that you do not find an answer before reporting the issue:

Describe the bug

  1. Trying to see how to simulate this through puppeteer. Load the page, scroll to the bottom, close the page to save it automatically.
  2. By default auto save is disabled, so made changes in the code locally and rebuild the extension to enable auto-save this tab.
  3. I also changed the default settings so auto save on tab removal option is on by default.
  4. Now the issue is that this still doesn't save the page on tab close, unless auto save radio button is toggled manually. It seems that there might be a list of tabs with auto save option on, which is missing, and turning auto save this tab on by default doesn't add it to that list.

Any help would be greatly appreciated, thanks...

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment

  • OS: [e.g. Win10 Pro, Ubuntu 18.04.1, Android 7.1.2]
  • Browser: [e.g. Chrome, Firefox]
  • Version: [e.g. 64]

Additional context
Add any other context about the problem here.

@gildas-lormeau
Copy link
Owner

What changes did you apply in SingleFile (related to this issue)?

@sanjeevApple
Copy link
Author

Sorry for the delay. I made changes in src/ui/bg/ui-menus.js to turn on MENU_ID_AUTO_SAVE_TAB to true. I also made changes in src/core/bg/config.js to enable autoSaveUnload: true. I think the issue was may be rebuilding the chromium zip file, because I was making the changes in the exploded directory directly and loading the extension through puppeteer. But these changes were being picked from lib, so rebuilding solved the issue.

Now it has been working really well, which helped solve the problem of saving long and content rich pages through singlefile cli. But from time to time, autosave on page unload does not save the file.

Here are the steps:

  1. Auto save this tab is the default in my set up and auto save on unload is true.
  2. I load the extension through puppeteer, go to the page www.apple.com/apple-vision-pro, simulate scroll to the bottom, and then call goBack to basically unload the page. This normally works for most pages, but from time to time fails for apple vision pro.
  3. You can easily simulate this in normal set up. Open chrome, get the singlefile extension, turn autosave on unload, open a tab, and turn on auto save this tab, and load the Url. Press on back arrow, and no file is saved. Use another Url like www.apple.com or www.apple.com/watch, everything works fine.

I think for some reason the save message is not coming through for some pages, in case they are heavy in content. I tried giving it time before I go back in that tab or before I close the browser, but it just does not produce a file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants