Redirect new window behaviour to new tab 04/319704/15
authorsidpaswan <s.paswan@samsung.com>
Wed, 30 Oct 2024 12:35:07 +0000 (18:05 +0530)
committerBot Blink <blinkbot@samsung.com>
Thu, 21 Nov 2024 04:54:51 +0000 (04:54 +0000)
This patch opens new tab instead of new window when a request is made.
It also redirects new window popups to new tab.

Change-Id: Ic4241079b21e8d1f5ede8f743efa565a78c658ad
Signed-off-by: sidpaswan <s.paswan@samsung.com>
third_party/blink/renderer/core/page/create_window.cc

index 5d49fa1b963b7a15de5d12f2987fd07c956a85e1..6c842845edc56c23db690f1fdf8e0ff17e76af64 100644 (file)
 #include "third_party/blink/renderer/platform/wtf/text/string_view.h"
 #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
 
+#if BUILDFLAG(IS_TIZEN)
+#include "base/command_line.h"
+#include "base/base_switches.h"
+#endif
+
 namespace blink {
 
 // Though absl::ascii_isspace() considers \t and \v to be whitespace, Win IE
@@ -187,6 +192,13 @@ WebWindowFeatures GetWindowFeaturesFromString(const String& feature_string,
     } else if (key_string == "popup") {
       // The 'popup' property explicitly triggers a popup.
       popup_state = value ? PopupState::kPopup : PopupState::kWindow;
+#if BUILDFLAG(IS_TIZEN)
+      if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+              switches::kEnableChrome)) {
+        LOG(INFO) << "Blocking Popup Window";
+        popup_state = PopupState::kWindow;
+      }
+#endif
     } else if (key_string == "height" || key_string == "innerheight") {
       window_features.height_set = true;
       window_features.height = value;