There are times when you need to test your app on real phones but you didn't deploy your site on the server so you can see it on your real device. We all know one option, you need to find your local ip address and port that your app is running and manually write it in your phone browser, that can be hard sometimes because example you have big url query or you need to test different urls etc...
In these situation this chrome extension come in game, when you are on you desired page localhost or some other url you just press it and it will generate QR code that u scan with your phone and bum 🎉 it open on your phone exactly like on your machine.
- It uses Crome extension react boilerplate
- Used react to write extension.
- Use react QR package
- Check if your Node.js version is >= 14.
- Clone this repository.
- Run
npm install
to install the dependencies. - Run
npm start
- Load your extension on Chrome following:
- Access
chrome://extensions/
- Check
Developer mode
- Click on
Load unpacked extension
- Select the
build
folder.
- Access
- Happy hacking.
To make your workflow much more efficient this boilerplate uses the webpack server to development (started with npm start
) with auto reload feature that reloads the browser automatically every time that you save some file in your editor.
You can run the dev mode on other port if you want. Just specify the env var port
like this:
$ PORT=6002 npm run start
After the development of your extension run the command
$ NODE_ENV=production npm run build
Now, the content of build
folder will be the extension ready to be submitted to the Chrome Web Store. Just take a look at the official guide to more infos about publishing.