Skip to content

Commit

Permalink
not finished
Browse files Browse the repository at this point in the history
  • Loading branch information
Notplayingallday383 committed Jul 31, 2024
1 parent 5a4d1d7 commit 371ccab
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 18 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,12 @@ Once you have the scripts served, register your service worker and set your tran
```js
if ('serviceWorker' in navigator) {
const registration = await navigator.serviceWorker.register('/sw.js')
BareMux.SetTransport(
"EpxMod.EpoxyClient", // replace with your transport
{ wisp: `wss://wisp-server-here.com` } // replace with the url of your wisp server
let connection = new BareMux.BareMuxConnection("/baremux/worker.js")
await connection.setTransport(
"/epoxy/index.mjs", // replace with your transport
[{
wisp: `wss://wisp-server-here.com`, // replace with the url of your wisp server
}]
)
})
}
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "meteorproxy",
"version": "1.0.6-patch.1",
"version": "1.0.6-patch.2",
"description": "The modern interception proxy you've been waiting for",
"type": "module",
"main": "./lib/index.cjs",
Expand Down Expand Up @@ -44,8 +44,7 @@
"husky": "^9.1.4",
"prettier": "^3.3.3",
"tsx": "^4.16.2",
"typescript": "^5.5.3",
"wisp-server-node": "^1.1.0"
"typescript": "^5.5.3"
},
"dependencies": {
"@mercuryworkshop/bare-mux": "^2.0.2",
Expand Down
39 changes: 27 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions src/bundle/rewrite/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,20 @@ function rewriteElement(element: Element, origin: URL) {
}
}

if (['link', 'a'].includes(element.name)) {
if (hasAttrib(element, 'href')) {
self.$meteor.util.log(element.attribs.href, 'green')
/*
if (typeof location !== "undefined") {
element.attribs.onclick = `
${location.href = element.attribs.href}
`
delete element.attribs.href
}
*/
}
}

for (const child of element.children) {
if (child.type === ElementType.ElementType.Tag) {
rewriteElement(child, origin)
Expand Down

0 comments on commit 371ccab

Please sign in to comment.