Background file append

I am creating an extension for use only on my kids laptops.

They keep clearing the history and I want to capture the URLs they are accessing and record them in a file. I have the code working to grab the URL for each page they visit. What I haven’t been able to figure out is how to append the grabbed URL into a file. I have searched for hours with no examples found. I am doing all of this in a background script.

The laptops are windows based. I plan on placing the file at c:\ext\file.txt. The directory will exit and the file will exit. I just need some points on the javascript snippet to append a line to the file.

Thank you

You cannot access files on the drive from the extension, it’s forbidden.
The only exception is the Downloads folder where you can create files with the downloads permission (I’m not sure how though).

But if you just need to record the values, you can save them in the browser.storage.local storage.