@staff0rd/assist 0.941.0 → 0.943.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/sessions/web/bundle.js +443 -443
- package/dist/index.js +10 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.
|
|
9
|
+
version: "0.943.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -1728,8 +1728,10 @@ function createBrowserLink(options2 = {}) {
|
|
|
1728
1728
|
const replies = createPendingReplies();
|
|
1729
1729
|
function onMessage(ws, raw) {
|
|
1730
1730
|
const message3 = parseLinkMessage(raw);
|
|
1731
|
-
if (message3?.type === "hello")
|
|
1732
|
-
|
|
1731
|
+
if (message3?.type === "hello") {
|
|
1732
|
+
console.log(`browser link: extension v${message3.version} connected`);
|
|
1733
|
+
state.open(ws, message3.version);
|
|
1734
|
+
} else if (message3?.type === "response") {
|
|
1733
1735
|
const { type: _type, id, ...reply2 } = message3;
|
|
1734
1736
|
replies.settle(id, reply2);
|
|
1735
1737
|
}
|
|
@@ -1738,6 +1740,7 @@ function createBrowserLink(options2 = {}) {
|
|
|
1738
1740
|
attach(ws) {
|
|
1739
1741
|
ws.on("message", (data) => onMessage(ws, data));
|
|
1740
1742
|
ws.on("close", () => {
|
|
1743
|
+
console.log("browser link: socket closed");
|
|
1741
1744
|
state.close(ws);
|
|
1742
1745
|
replies.dropSocket(ws);
|
|
1743
1746
|
});
|
|
@@ -1915,6 +1918,10 @@ function attachSessionSocket(server, ctx) {
|
|
|
1915
1918
|
} else if (req.url === BROWSER_LINK_PATH && isExtensionOrigin(req.headers.origin)) {
|
|
1916
1919
|
wss.handleUpgrade(req, socket, head, (ws) => browserLink.attach(ws));
|
|
1917
1920
|
} else {
|
|
1921
|
+
if (req.url === BROWSER_LINK_PATH)
|
|
1922
|
+
console.log(
|
|
1923
|
+
`browser link: refused origin ${req.headers.origin ?? "(none)"}`
|
|
1924
|
+
);
|
|
1918
1925
|
socket.destroy();
|
|
1919
1926
|
}
|
|
1920
1927
|
});
|