Skip to content
This repository has been archived by the owner on Jul 4, 2022. It is now read-only.

Commit

Permalink
Fix google search
Browse files Browse the repository at this point in the history
  • Loading branch information
Gusted committed Feb 25, 2021
1 parent e280c7c commit 1720179
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ yarn-error.log
.eslintcache
tsconfig.tsbuildinfo
public/

.vercel
6 changes: 4 additions & 2 deletions src/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ document.addEventListener('submit', (e) => {
// TO-DO
// const method = {method: 'post', body: new FormData(document.activeElement.form)};
} else {
const absoluteURL = getAbsoluteURL(window.top.location.href.substring(window.top.location.href.indexOf('url=') + 4), (document.activeElement as any).form.action);
window.top.location.href = `${window.top.location.href.substring(0, window.top.location.href.indexOf('?') + 1)}url=${absoluteURL}?${new URLSearchParams(new FormData((document.activeElement as any).form) as any)}`;
const topHref = window.top.location.href;
const absoluteURL = getAbsoluteURL(topHref.substring(topHref.indexOf('url=') + 4), (document.activeElement as any).form.action);
const SearchParams = new URLSearchParams(new FormData((document.activeElement as any).form) as any);
window.top.location.href = `${topHref.substring(0, topHref.indexOf('?'))}?url=${encodeURIComponent(`${absoluteURL}?${SearchParams}`)}`;
}
}
});
1 change: 0 additions & 1 deletion tasks/http-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const http = require('http');
const httpProxy = require('http-proxy');
const corsAnywhereIframe = require('cors-anywhere-iframe');


const serveHandler = require('serve-handler');

const proxyServer = httpProxy.createServer();
Expand Down

0 comments on commit 1720179

Please sign in to comment.