mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-12 18:39:58 +00:00
Namespace messageProxy (sendMessage)
This commit is contained in:
@@ -67,7 +67,7 @@ window.addEventListener("load", () => {
|
|||||||
htmlReporter.initialize();
|
htmlReporter.initialize();
|
||||||
|
|
||||||
// Use messageProxy socket to request spec injection
|
// Use messageProxy socket to request spec injection
|
||||||
window.sendMessage({
|
messageProxy.sendMessage({
|
||||||
subject: "injectSpecs"
|
subject: "injectSpecs"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,8 +3,10 @@
|
|||||||
// Create socket connection
|
// Create socket connection
|
||||||
const socket = new WebSocket("ws://localhost:8080");
|
const socket = new WebSocket("ws://localhost:8080");
|
||||||
|
|
||||||
window.sendMessage = (message) => {
|
window.messageProxy = {
|
||||||
socket.send(JSON.stringify(message));
|
sendMessage (message) {
|
||||||
|
socket.send(JSON.stringify(message));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const reporterMethods = [
|
const reporterMethods = [
|
||||||
@@ -21,7 +23,7 @@ const customReporter = {};
|
|||||||
// Populate reporter methods
|
// Populate reporter methods
|
||||||
for (const method of reporterMethods) {
|
for (const method of reporterMethods) {
|
||||||
customReporter[method] = function (result) {
|
customReporter[method] = function (result) {
|
||||||
sendMessage({
|
messageProxy.sendMessage({
|
||||||
subject: method
|
subject: method
|
||||||
, data: result
|
, data: result
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user