Operaised -- The blog

Distinguishing between opening new windows on a page and where ever else.

When navigating around Opera and you want to be able to do a supersearch for example, using the recent javascript options, its been impossible to remove the empty page with the javascript: uri inside it. Here's ways of how to disable it at any cost.

1. Always void when opening a new window. This way doesnt allow the original page to be overwritten. Example below:

 javascript:void(window.open('about:blank')) 


Which opens about:blank in a new window. and the original web page stays intact.

2. Use an if function to check if the window's location protocol opened is javascript: and target the self or open a new window accordingly.

 javascript:if(location.protocol=='javascript:'){alert('Opening page on javascript protocol');window.self.location='about:blank';}else{alert('Opening in new window');window.open('about:blank')} 


3. Use same method of checking for javascript: protocol in 2, but instead of setting a window.self.location, use window.close() instead.

 javascript:if(location.protocol=='javascript:'){window.open('about:blank');window.open('about:blank');window.open('about:blank');window.close();}else{void(window.open('about:blank'));void(window.open('about:blank'));void(window.open('about:blank'));} 


That should help in the steps of making a supersearch or simalar method of opening windows without the useless blank page. smile

zIndex tabbed interface testcase.New Flashblock.css with extra features.

Write a comment

New comments have been disabled for this post.