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

Unnecessary copy operations in profile folder #53

Closed
kevonfernando opened this issue Sep 2, 2021 · 3 comments
Closed

Unnecessary copy operations in profile folder #53

kevonfernando opened this issue Sep 2, 2021 · 3 comments
Labels
bug Something isn't working
Milestone

Comments

@kevonfernando
Copy link

Description

Whenever a new FirefoxPWA window is opened, all contents in the profile folder under chrome/pwa/... are being overwritten by the default files. I have not checked if any other files are also being overwritten. I thought I would report this as it is a bit of an odd behaviour in my opinion.

Steps to Reproduce

  1. Try to edit anything in the profile folder under chrome/pwa/
  2. Save changes
  3. Restart the FirefoxPWA window
  4. See no changes in the FirefoxPWA window and all changes in the files under chrome/pwa/ being gone

Environment

  • Operating system: Windows 10
  • System architecture: 64-bit
  • Installation method: Chocolatey
  • FirefoxPWA extension version: 1.0.0
  • FirefoxPWA native version: 1.0.0
  • Firefox version: 91.0.2
@kevonfernando kevonfernando added the bug Something isn't working label Sep 2, 2021
@filips123
Copy link
Owner

It only overwrites/copies chrome/pwa and startupCache in the profile, and _autoconfig.cfg and defaults/pref/autoconfig.js in the Firefox installation (and some additional files on macOS, but this is actually needed on every launch so OS integration works correctly). I did this to make sure UserChrome stuff is always up-to-date, as updating them when package updates would be harder because user may have multiple OS and Firefox profiles.

Maybe the program could do this only when files actually differ from the latest installed version (C:\Program Files\FirefoxPWA\userchrome on Windows) but I'm not sure what the best way of checking if files need update would be. Perhaps it could check the hash/content of chrome/pwa/chrome.jsm as it contains package version which should be changed with every new release.

@kevonfernando
Copy link
Author

What about a script that only runs on package updates/installations to reduce overwrites. Should that not be possible? Your idea also sounds good. Maybe you could do that with an extra version file. But to be honest, I do not know to much about this topic. This behaviour just stood out to me while I was messing with the files in chrome/pwa and thought I should tell you.

@filips123 filips123 added this to the 1.4.0 milestone Dec 26, 2021
@filips123
Copy link
Owner

I added a check to only copy files to the profile if the global chrome/pwa/chrome.jsm is newer than the profile file. Because that file contains version, it should be automatically copied on every release. Always copying files can still be enabled in the extension settings. Note that on macOS it still copies files every time, because this is needed to properly set PWA name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants