5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 06:01:52 +08:00
wails/v2/internal/frontend/runtime/desktop/ipc.js
2021-09-14 20:24:14 +10:00

33 lines
650 B
JavaScript

/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ )
|__/|__/\__,_/_/_/____/
The electron alternative for Go
(c) Lea Anthony 2019-present
*/
/* jshint esversion: 6 */
/**
* SendMessage sends the given message to the backend
*
* @param {string} message
*/
// const windows = 0;
// const linux = 1;
// const macos = 2;
window.WailsInvoke = function (message) {
// Call Platform specific invoke method
if (PLATFORM === 0) {
window.chrome.webview.postMessage(message);
} else if (PLATFORM === 1) {
window.blah();
} else if (PLATFORM === 2) {
console.error("Unsupported Platform");
}
};