Note: this application has serious bugs that I won't be fixing. I've moved on to using Bun on a very fast computer version without the bugs: https://github.com/colinkeenan/rentapBun, and even have a version that works on Android using Termux linux terminal emulator: https://github.com/colinkeenan/rentapTermux. Both versions work very well and look better too.
Create/save/print Rental Applications (Node.js version)
This is a port of my Mozilla Firefox Extension rentap to npm. You must install npm.
Rental Application can easily be run from your user's home folder by following these steps:
For Windows instructions, click here
mkdir ~/nodejs
cd ~/nodejs
npm install rentap
- Find
store.json
in a hidden subdirectory of your home directory:find ~/.mozilla -name store.json
- Copy or link it to
~/nodejs/node_modules/rentap/import_storejson
Example:ln -s ~/.mozilla/icecat/vytcev6r.default-1510880606244/jetpack/jid1-E1afJi6vbTfsRg@jetpack/simple-storage/store.json ~/nodejs/node_modules/rentap/import_storejson/store.json
cd ~/nodejs/node_modules/rentap/import_storejson
node import_storejson
and follow any prompts if it needs input from youmv store.db ..
cd ~/nodejs/node_modules/rentap
npm start
- Open any browser to http://localhost:3000 or http://127.0.0.1:3000
- To stop the www server, run
npm stop
in~/nodejs/node_modules/rentap
.
-
Run as above and open in Google Chrome
-
Click the 3-vertical-dot Google Chrome menu and choose More Tools -> Create Shortcut...
-
Checkmark "Open As Window" if you want it to look like a separate ap instead of a tab
-
Find the desktop file created by Google Chrome:
grep "Rental Application" ~/.local/share/applications/*desktop
-
Find the Exec command in the desktop file just found. For example,
grep Exec ~/.local/share/applications/chrome-onobjhkphejolhnnbkgckmkjhpoelkgh-Default.desktop
-
Create
rentap
with the following code in it where the last line is the Exec command found in the previous step.#!/bin/sh if test ! -f /tmp/rentap-server-running then rentap-server & fi /opt/google/chrome/google-chrome --profile-directory=Default --app-id=onobjhkphejolhnnbkgckmkjhpoelkgh
-
chmod +x rentap
-
sudo mv rentap /usr/local/bin
-
Create
rentap-server
with the following code in it.#!/bin/sh cd ~/nodejs/node_modules/rentap npm start > /tmp/rentap-server-running rm /tmp/rentap-server-running
-
chmod +x rentap-server
-
sudo mv rentap-server /usr/local/bin
-
Edit the desktop file found previously and set
Exec=rentap
Now you can launch Rental Application like any other on your linux desktop.
If the page displays an error, then press F5 to refresh, and maybe ad a sleep 4
or whatever length of time works after npm start ...
in rentap-server
.
To stop the www server, run npm stop
in ~/nodejs/node_modules/rentap
.
Since the file /tmp/rentap-server-running
is in /tmp
(which is in memory only), it will be deleted on reboot even if rentap
didn't get to delete it.
mkdir ~\nodejs
cd ~\nodejs
npm install rentap
- Find
store.json
in a hidden subdirectory of your home directory:dir ~\AppData -recurse -ea 0 | % FullName | sls "store.json"
- Copy it to
~\nodejs\node_modules\rentap\import_storejson
Example:cp ~\AppData\Roaming\Mozilla\Firefox\Profiles\4wvnz10q.default\jetpack\jid1-E1afJi6vbTfsRg@jetpack\simple-storage\store.json ~\nodejs\node_modules\rentap\import_storejson
cd ~\nodejs\node_modules\rentap\import_storejson
node import_storejson
and follow any prompts if it needs input from youmv store.db ..
cd ~\nodejs\node_modules\rentap
npm start
- Open any browser to http://localhost:3000 or http://127.0.0.1:3000
- To stop the www server, run
npm stop
in~/nodejs/node_modules/rentap
.
-
Run as above and open in Google Chrome
-
Click the 3-vertical-dot Google Chrome menu and choose More Tools -> Create Shortcut...
-
Checkmark "Open As Window" if you want it to look like a separate ap instead of a tab
-
Get the command that launches the ap:
- Windows Menu -> All apps -> Recently added -> Rental Application, right click it and choose More...-> Open file location
- In the window that pops up, find the Rental Application shortcut and right click it, choosing Properties
- The "Target" will already be highlighted, so press Ctrl+c to copy it.
-
Cancel the Properties window but keep the window showing the shortcut.
-
Create
~\rentap.ps1
with the following code in it where the last line is a modified version of the "Target" that was copied in step 4. That last line splits the "Target" into a FilePath and an ArgumentList. Looking at the example in this script should make it clear how to do it.if (!(Test-Path "~\AppData\Local\Temp\rentap-server-running")) { Start-Job -FilePath "~\rentap-server.ps1" sleep 5 } Start -FilePath "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -ArgumentList "--profile-directory=Default --app-id=onobjhkphejolhnnbkgckmkjhpoelkgh" cd ~\nodejs\node_modules\rentap
My Windows computer is slow, so I added a
sleep 5
. This line may not be necessary, or 5 may be too long or too short - experiment. -
Create
~\rentap-server.ps1
with the following code in it:cd ~\nodejs\node_modules\rentap npm start > "~\AppData\Local\Temp\rentap-server-running" rm "~\AppData\Local\Temp\rentap-server-running"
The
rentap-server-running
file won't be deleted until the server is stopped withnpm stop
in the window showing the server is running. -
Go back to the window showing the
Rental Application
shortcut, right click it, and choose Properties. -
Delete the highlighted "Target" and insert the following:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoExit -File C:\Users\Colin\rentap.ps1
Of course, replace "Colin" with your username.
-
Turns out Windows doesn't delete the contents of
~\AppData\Local\Temp\
on reboot, so it's necessary to create a script to deleterentap-server-running
and put it in the startup folder (in case the computer reboots beforerentap-server.ps1
has the chance to delete the file).- Create
~\rentap-not-running.ps1
with just one line:
rm "~\AppData\Local\Temp\rentap-server-running"
- Open Windows startup folder: Right-click on the start menu, choose Run, and type
Shell:common startup
. This should bring up"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup"
. - Open your home folder, Right-click on
rentap-not-running.ps1
and create a shortcut. - Drag the shortcut to the Startup folder (and allow administrative privilages to do it).
- Right-click the shortcut just moved to the Startup folder and change the Target, inserting the following at the beginning:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File
(and allow administrative privilages to do it). - For example, my Target looks like this:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File C:\Users\Colin\rentap-not-running.ps1
- Create
Now you can launch Rental Application like any other. If on first launch, the page displays an error, press F5 to refresh the page because it tried to display the page before the server was up. You may need to play around with the line that says sleep 5
in the example script above.
To stop the www server, run npm stop
in the PowerShell window showing that it is running.