Javascript window.print() in chrome, closing new window or tab instead of cancelling print leaves javascript blocked in parent window

It looks like the problem had been resolved with the latest Chrome update… I’m running the Chrome Version 36.0.1964.4 dev-m. I was limited too warning the user from closing print preview window by doing the following: if(navigator.userAgent.toLowerCase().indexOf(‘chrome’) > -1){ // Chrome Browser Detected? window.PPClose = false; // Clear Close Flag window.onbeforeunload = function(){ // Before … Read more

Open new window by POST using h:commandButton

The only non-JS way is to set target=”_blank” in the parent <h:form>. <h:form target=”_blank”> … <h:commandButton value=”Open in new Window” /> </h:form> This however affects all non-ajax(!) actions which are performed in the very same form. So if you’re smart, make the action which shouldn’t open in a new window an ajax action. However, ajax … Read more

Can I create links with ‘target=”_blank”‘ in Markdown?

As far as the Markdown syntax is concerned, if you want to get that detailed, you’ll just have to use HTML. <a href=”http://example.com/” target=”_blank”>Hello, world!</a> Most Markdown engines I’ve seen allow plain old HTML, just for situations like this where a generic text markup system just won’t cut it. (The StackOverflow engine, for example.) They … Read more

How to switch to the new browser window, which opens after click on the button?

You can switch between windows as below: // Store the current window handle String winHandleBefore = driver.getWindowHandle(); // Perform the click operation that opens new window // Switch to new window opened for(String winHandle : driver.getWindowHandles()){ driver.switchTo().window(winHandle); } // Perform the actions on new window // Close the new window, if that window no more … Read more