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

(Improvement) move "Service Worker" to "Cache" folder and preference "Clear Cache on exit" #115

Closed
cra3yk opened this issue Oct 30, 2024 · 8 comments
Labels
enhancement New feature or request

Comments

@cra3yk
Copy link

cra3yk commented Oct 30, 2024

Hi

Big thank You for chrome plus (I'm using mostly to mitigate preference encryption by chrome/chromium).

The separate Cache folder is great idea, but there is another "big boy" folder, that is often full of garbage - Service Worker (which is in profile -> Default -> Service Worker). It is keep growing over time and if You delete it, then the next visit to web site (that using service workers) will recreate it with its content - no big loss.

But the current version of "chrome plus" has a lack of "clear cache on exit" switch/preference (1 - clear, 0 - leave).
It will be great to have one 😄

Please 😃

@cra3yk cra3yk changed the title (Improvement) add "Service Worker" to "Cache" folder and Clear Cache on exit (Improvement) move "Service Worker" to "Cache" folder and preference "Clear Cache on exit" Oct 30, 2024
@Bush2021
Copy link
Owner

The Cache folder is created by Chrome as part of the browser’s native functionality. Chrome++ only adds command line switches to Chrome without altering its content. Hence, I disagree with moving Service Worker into the Cache folder.

Given the complexity of the user data folder structure and the differing needs of each user, I do not believe it is appropriate for me to specify which "junk" files should be cleared. However, I am open to adding a feature that runs a specific program or script upon Chrome's startup or termination. What do you think?

@cra3yk
Copy link
Author

cra3yk commented Oct 31, 2024

I am open to adding a feature that runs a specific program or script upon Chrome's startup or termination. What do you think?

Great idea - with this I could run .bat script (or autokey's exe) to clean Cache and Service Worker folder (on exit)

@Bush2021 Bush2021 added the enhancement New feature or request label Nov 2, 2024
Bush2021 added a commit that referenced this issue Nov 2, 2024
…ection (#115) (#117)

* feat: add `launch_on_exit` functionality

* feat: add `launch_on_startup` functionality

* feat: add `kill_launch_on_exit` and first run detection

* comment

* feat: update LaunchCommands to accept show_command parameter for better control

* chore: reorder parameters in `LaunchCommands` for consistency
@Bush2021
Copy link
Owner

Bush2021 commented Nov 2, 2024

@cra3yk
Copy link
Author

cra3yk commented Nov 2, 2024

I've tried - it doesn't handle spaces in the path (the path, where chrome.exe is, contains space)
The 4 scenarios were tested.

launch_on_exit="%app%\_clean.cmd"
launch_on_exit=%app%\_clean.cmd
launch_on_exit=O:\_Repository_\Net\Web Browser\Chrome-like\Vivaldi\Vivaldi\_clean.cmd
launch_on_exit="O:\_Repository_\Net\Web Browser\Chrome-like\Vivaldi\Vivaldi\_clean.cmd"

obraz

@Bush2021
Copy link
Owner

Bush2021 commented Nov 2, 2024

Try adding a semicolon at the end, for example: launch_on_exit="%app%\\_clean.cmd";

@cra3yk
Copy link
Author

cra3yk commented Nov 2, 2024

With semicolon working well.
I want to pass cache and profile path to my script using this:

launch_on_exit="%app%\_clean.cmd" "%cache_dir%" "%data_dir%;

But it seems to that both variables are empty (i can only pass path by name itself)
obraz

@Bush2021
Copy link
Owner

Bush2021 commented Nov 2, 2024

With semicolon working well. I want to pass cache and profile path to my script using this:

In fact, there are still some issues with path handling, and I will make some changes later.

I want to pass cache and profile path to my script using this:
launch_on_exit="%app%\_clean.cmd" "%cache_dir%" "%data_dir%;
But it seems to that both variables are empty (i can only pass path by name itself)

This is expected behavior, currently only the Windows standard environment variables and %app% are supported.

@cra3yk
Copy link
Author

cra3yk commented Nov 2, 2024

Ok. I just made _clean.cmd in this way and my live became simpler ;-)

@echo off
rd /s /q "%~dp0..\data\BrowserMetrics"
rd /s /q "%~dp0..\data\Crashpad"
rd /s /q "%~dp0..\data\GraphiteDawnCache"
rd /s /q "%~dp0..\data\GrShaderCache"
rd /s /q "%~dp0..\data\ShaderCache"
rd /s /q "%~dp0..\data\Default\Cache"
rd /s /q "%~dp0..\data\Default\DawnGraphiteCache"
rd /s /q "%~dp0..\data\Default\DawnWebGPUCache"
rd /s /q "%~dp0..\data\Default\GPUCache"
rd /s /q "%~dp0..\data\Default\optimization_guide_hint_cache_store"
rd /s /q "%~dp0..\data\Default\Service Worker"

del /f "%TEMP%\mat-debug-*"
for /f "tokens=*" %%i in ('dir "%TEMP%\chrome_url_fetcher_*" /b') do rd "%TEMP%\%%i" /s /q
rd /s /q "%TEMP%\chrome_url_fetcher_*"

rd /s /q "%~dp0..\Cache"
mkdir "%~dp0..\Cache"
exit

@cra3yk cra3yk closed this as completed Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants