[WRTjs][VD] Support skip inspector popup 24/321124/2
authorzhaosy <shiyusy.zhao@samsung.com>
Tue, 19 Nov 2024 10:31:45 +0000 (18:31 +0800)
committerBot Blink <blinkbot@samsung.com>
Thu, 28 Nov 2024 06:55:21 +0000 (06:55 +0000)
In b2b product, sometimes, developer don't want to show inspector popup
in RWI case, so support skip inspector popup.

How to skip inspector popup:
1) Launch AppInfoViewer(mute + 1 + 2 + 2 + 6 + exit)
2) Select DebugInfo
3) Press UP-UP-DOWN-DOWN-LEFT-RIGHT-LEFT-RIGHT
4) Select On option

Refer to:
https://review.tizen.org/gerrit/#/c/platform/framework/web/wrtjs/+/320894/

Change-Id: I35842b21e1f82498efeec49a812142a28bcd643d
Signed-off-by: zhaosy <shiyusy.zhao@samsung.com>
(cherry picked from commit 06fe463a486c98c0e2106aa2fccdd93c36ffba14)

wrt/native_wrtjs.d.ts
wrt/src/browser/api/tv/wrt_api_tv_extension.cc
wrt/src/browser/api/tv/wrt_api_tv_extension.h

index 2524c7ad038763d1beeb6dd05af71f7a86f0afda..cd6adb036cc76a57cbc9c93c656401a7fbcd1944 100755 (executable)
@@ -137,6 +137,7 @@ declare namespace NativeWRTjs {
     setDiskCache(option: string): void;
     setWasmFlags(): void;
     showDialog(webContents: Electron.WebContents, message: string): void;
+    skipInspectorPopup(): boolean;
     takeScreenshot(fileName: string, scale: number): void;
     queryProductValue(query: string): string;
   }
index 1d0181105f66f278e7df599592fe237259874603..508390469223fcf3f76a33298b43254d644fe0c4 100644 (file)
@@ -87,6 +87,15 @@ bool TVExtension::NeedUseInspector() const {
   return inspected_appid == ApplicationData::GetInstance().app_id();
 }
 
+bool TVExtension::SkipInspectorPopup() const {
+  absl::optional<bool> skip_inspector_popup =
+      VconfHandle("db/wrt/skip_inspector_popup").Bool();
+  if (skip_inspector_popup.has_value())
+    return skip_inspector_popup.value();
+
+  return false;
+}
+
 bool TVExtension::IsAlwaysReload() const {
   auto& app_data = ApplicationData::GetInstance();
   if (app_data.meta_data_info().HasKey(kLoadDefaultURI) &&
@@ -424,6 +433,7 @@ gin::ObjectTemplateBuilder TVExtension::GetObjectTemplateBuilder(
       .SetMethod("setDiskCache", &TVExtension::SetDiskCache)
       .SetMethod("setWasmFlags", &TVExtension::SetWasmFlags)
       .SetMethod("showDialog", &TVExtension::ShowDialog)
+      .SetMethod("skipInspectorPopup", &TVExtension::SkipInspectorPopup)
       .SetMethod("takeScreenshot", &TVExtension::TakeScreenshot);
 }
 
index 0ed909cf0f7d00373444acf23cbce13c7486cfa0..076bbd65087f45db18d1ad8c8fd2df93b0e5cf07 100644 (file)
@@ -35,6 +35,7 @@ class TVExtension : public gin::Wrappable<TVExtension>,
   bool GetMultitaskingSupport() const;
   bool IsAlwaysReload() const;
   bool NeedUseInspector() const;
+  bool SkipInspectorPopup() const;
 
   void CancelDialogs(content::WebContents* web_contents) const;
   void ClearSurface(content::WebContents* web_contents) const;