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