Allow Page to open window for tizen applications 05/191405/4
authorSuneel Kota <suneel.kota@samsung.com>
Tue, 16 Oct 2018 13:25:57 +0000 (18:55 +0530)
committerjaekuk lee <juku1999@samsung.com>
Tue, 23 Oct 2018 10:59:28 +0000 (10:59 +0000)
the page is allowed to open a window only when CanCreateWindow
is true, in this case no_javascript_access indicates
weather the window created should be scriptable in same process
hence it is made false

Change-Id: I1376ad5ac52ab1d5031177c064f490c1487cf8e1
Signed-off-by: Suneel Kota <suneel.kota@samsung.com>
atom/browser/atom_browser_client.cc

index 9b9cfd1..d1ee230 100644 (file)
@@ -336,6 +336,15 @@ bool AtomBrowserClient::CanCreateWindow(
   if (!atom::Browser::Get()->ShouldAllowNavigation(target_url.spec()))
     return false;
 
+#if defined(OS_TIZEN)
+  auto app_data = common::ApplicationDataManager::GetCurrentAppData();
+  if (app_data && !app_data->IsElectronApp()) {
+    // Window can be opened from script for Tizen Apps
+    // hence no need to check user_gesture
+    *no_javascript_access = false;
+    return true;
+  }
+#endif
   if (IsRendererSandboxed(render_process_id)) {
     *no_javascript_access = false;
     return true;