Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions examples/send-plugin-message/pluginMessageApp.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@

<script>

var bsMessage = new BSMessagePort();
const MESSAGE_PORT = require("@brightsign/messageport");
const bsMessage = new MESSAGE_PORT();

function main() {
console.log("=== Starting javascript...");

bsMessage.addEventListener('bsmessage', function (msg) {
if (msg.data["serialnumber"] !== undefined && msg.data["filename"] !== undefined) {
console.log("=== The plugin sent a message with serialNumber: " + msg.data["serialnumber"] + " and filename: " + msg.data["filename"]);
if (msg["serialnumber"] !== undefined && msg["filename"] !== undefined) {
console.log("=== The plugin sent a message with serialNumber: " + msg["serialnumber"] + " and filename: " + msg["filename"]);

// Add fields from plugin message
var serialNumber = msg.data["serialnumber"];
var filename = msg.data["filename"];
var serialNumber = msg["serialnumber"];
var filename = msg["filename"];

// send info to your backend (replace console log with your backend call)
console.log("=== This is where you send info to the backend: " + serialNumber + " " + filename);
Expand Down