This is a simple universal console that all scripts (popup, content, background, etc.) can log to, for debugging Safari extensions 10x faster.
You can run it on your own server using the below instructions, but keep in mind that if you run it on the same machine as your wallet emulator, it won't work.
Apple's won't let you make XHR requests from extension JavaScript code to localhost on your own machine. Use an external web server instead.
There's a few dependencies to install:
npm inode server.js will run the logger on port 3000.
However, you'll likely want to instead run server.js more persistently with a process manager like pm2, so that the logger stays running even when you terminate your session:
npx pm2 start server.jsLastly, just forward traffic from port 80 to port 3000.
To display the pm2 status table:
npx pm2 statusTo stop running the logger using pm2:
npx pm2 stop <ID>Replace <ID> with the id on the far-left column of the pm2 status table row where the name column is server.
For example: npx pm2 stop 0