Grabbed dndbeyond's source code
``` ~/go/bin/sourcemapper -output ddb -jsurl https://media.dndbeyond.com/character-app/static/js/main.90aa78c5.js ```
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { MobileMessage } from "./typings";
|
||||
|
||||
/**
|
||||
*
|
||||
* @param message
|
||||
*/
|
||||
export function sendMessage(message: MobileMessage): void {
|
||||
if ((window as any)?.webkit?.messageHandlers?.mobileApp?.postMessage) {
|
||||
// This should not be stringify'd because iOS is fine with objects
|
||||
// https://github.com/DnDBeyond/ddb-character-tools-client/pull/306
|
||||
(window as any).webkit.messageHandlers.mobileApp.postMessage(message);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((window as any)?.mobileApp?.postMessage) {
|
||||
(window as any).mobileApp.postMessage(JSON.stringify(message));
|
||||
return;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user