[Addon] Add event for message sending to addon. 23/259823/8
authorAron kim <aron.kim@samsung.com>
Tue, 15 Jun 2021 07:37:04 +0000 (00:37 -0700)
committerAron kim <aron.kim@samsung.com>
Tue, 14 Sep 2021 06:52:45 +0000 (23:52 -0700)
Notify messages to Addon from web engine

Change-Id: Ib4df2dec07faa3e2288734c0c64e1f638f99201a
Signed-off-by: Aron kim <aron.kim@samsung.com>
wrt_app/src/addon_manager.ts
wrt_app/src/runtime.ts

index aeb6943..299bdce 100644 (file)
@@ -50,7 +50,8 @@ const EventList = [
   'lcQuit',           // An app is quitted
   'hwDownkey',        // Down key is pressed
   'hwUpkey',          // Up key is pressed
-  'contentDidFinishLoad' // The navigation is done and 'onload' was dispatched
+  'contentDidFinishLoad', // The navigation is done and 'onload' was dispatched
+  'message'
 ];
 Object.freeze(EventList);
 
index 947bb76..f92cfeb 100644 (file)
@@ -111,6 +111,8 @@ class Runtime {
         event.preventDefault();
       } else if (type === 'hideSplashScreen') {
         this.webApplication?.hideSplashScreen(params[0]);
+      } else if (type === 'selectionText') {
+        addonManager.emit('message', type, params[0]);
       }
     });