localhostify
Advanced tools
Comparing version 0.1.0 to 0.1.1
const fs = require('fs'); | ||
const version = require('../package.json').version; | ||
@@ -26,2 +27,2 @@ const config = require(process.cwd() + '/.localhostify.js'); | ||
console.log("Localhostify: Chrome Ext created in localhostify-ext folder."); | ||
console.log(`Localhostify ${version}: Chrome Ext created in localhostify-ext folder.`); |
{ | ||
"name": "Localhostify", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"manifest_version": 2, | ||
@@ -5,0 +5,0 @@ "description": "Localhostify: External redirects interceptor", |
@@ -9,15 +9,10 @@ /** | ||
chrome.runtime.onInstalled.addListener(function () { | ||
chrome.storage.sync.set({ active: localhostifyEnabled }, function () { | ||
console.log('Active :', localhostifyEnabled); | ||
}); | ||
}); | ||
function onIconClick(toggle) { | ||
chrome.storage.sync.get(['active'], function (data) { | ||
const active = toggle ? !data.active : data.active; | ||
console.log('StorageGet Active :', JSON.stringify(data)); | ||
const active = toggle ? !data.active : data.active === undefined ? localhostifyEnabled : data.active; | ||
localhostifyEnabled = active; | ||
chrome.browserAction.setIcon({ path: active ? 'assets/green.png' : 'assets/red.png' }); | ||
chrome.storage.sync.set({ active }, function () { | ||
console.log('Active 1:', active); | ||
console.log('StorageSet Active set:', active); | ||
}); | ||
@@ -56,3 +51,3 @@ }); | ||
{ urls: ['<all_urls>'] }, | ||
['responseHeaders', 'blocking'], | ||
['blocking', 'responseHeaders', chrome.webRequest.OnHeadersReceivedOptions.EXTRA_HEADERS].filter(Boolean), | ||
); |
{ | ||
"name": "localhostify", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Easy HTTP reverse proxy - localhost:3001 -> prod.domain.com", | ||
@@ -5,0 +5,0 @@ "source": "src/index.js", |
@@ -1,5 +0,5 @@ | ||
<p align="center"> | ||
<h3 align="center"> | ||
<a href="https://www.npmjs.com/package/localhostify"><img src="https://img.shields.io/npm/v/localhostify.svg?style=flat-square"></a><br/> | ||
localhostify - Because real-backends matters!! | ||
</p> | ||
Because real-backends matters!! | ||
</h3> | ||
@@ -10,3 +10,3 @@ # 💥 localhostify | ||
``` | ||
```properties | ||
locahost:3001 === https://prod.domain.com/api/* & http://localhost:3000/* | ||
@@ -19,3 +19,3 @@ locahost:3002 === https://staging.domain.com/api/* & http://localhost:3000/* | ||
`.localhostify.js` | ||
```javascript | ||
```js | ||
module.exports = { | ||
@@ -57,3 +57,3 @@ prod: { | ||
## 💥 Run | ||
```shell | ||
``` | ||
your-dev-server start | ||
@@ -72,3 +72,3 @@ npx localhostify prod | ||
```shell | ||
``` | ||
npx localhostify --chrome-ext | ||
@@ -81,2 +81,7 @@ ``` | ||
It the browser is opened, refresh all the exstensions. | ||
Disable the ext if you are on `prod.domain.com`, otherwise it will redirect to locahost!</br> | ||
<img width="159" alt="on" src="https://user-images.githubusercontent.com/20126259/137299423-ece3b5fc-d959-4a22-b325-ecd11ccd4487.png"> | ||
<img width="162" alt="off" src="https://user-images.githubusercontent.com/20126259/137299440-92e3f789-54e3-460b-847f-bef52ccdf468.png"> | ||
</br></br> | ||
@@ -83,0 +88,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46626
98
271