From: Suneel Kota Date: Tue, 16 Oct 2018 13:25:57 +0000 (+0530) Subject: Allow Page to open window for tizen applications X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F05%2F191405%2F4;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git Allow Page to open window for tizen applications 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 --- diff --git a/atom/browser/atom_browser_client.cc b/atom/browser/atom_browser_client.cc index 9b9cfd1ea..d1ee230cc 100644 --- a/atom/browser/atom_browser_client.cc +++ b/atom/browser/atom_browser_client.cc @@ -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;