How do i block websites from opening up new windows
-
So the default adblock block most pop-ups but how about websites that open new windows? Not tabs or pop-ups but new windows when i click on something in the website? How can i block that?
-
@couch Hi, do you have an example of such a popup? In plain HTML code using a link target of
_blank
will open a new tab, not a window. And then there's popup windows using Javascriptwindow.open()
which is not strictly the same as a new window, which are still allowed as long as the user clicks the link.Examples:
Link with
target="_blank"
:
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_a_targetLink using standard
window.open()
:
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_openLink making a popup window:
https://www.w3schools.com/code/tryit.asp?filename=GUY96EN0XJM3Note in the last example the new window has no status or tab bar as a popup window.
-
@couch You can use the "Popup Blocker (strict)" extension. Be warned: It is a third-party extension! Use at your own risk. Still, it's probably less of a risk then the pop-ups.
-
@pathduck , I have a example of this behavior, the page of the spanish TV guide https://www.tvguia.es
If you click in the link of the FilmAffinity
to read information from the film, orin the other information links, it open a new small Vivaldi window of this page, because it pointed to this modified URL -
@catweazle Yes, that's a popup window, it uses
window.open()
<script type="text/javascript"> function OpenWindow (URL){window.open(URL,'','scrollbars=yes,menubar=no,height=650,width=1000,resizable=yes,toolbar=yes,location=yes,status=yes')}; </script>
And no, I don't think these can be blocked, maybe through an extension.
-
@pathduck , the only way is to copy and go to the clean URL. But of this somthing anyyoing behavior, at least this page is clean. Although, apart from this somewhat annoying behavior, the page luckily is clean, usual cookies that are blocked anyway.
-
@pathduck
All those links open in the same tab for me. I have a script which turns target="_blank" into target="_self" (the default for links) because there is a potential exploit for target="_blank". -
uBlockOrigin could help with a rule
no-popups: vivaldi.com true
See https://github.com/gorhill/uBlock/wiki/Per-site-switches#no-popups -
Ppafflick moved this topic from Security & Privacy on