prevent popup from opening new window in Ie6 - internet-explorer-6

I create a popup using window.open in IE6. Created popup contains a link to other page, which i want to show in the same popup window, but after clicking on the link, the target page is displayed in another brand new popup, so i have 2 popups opened at that moment.
How can i make a new page loaded in the same popup that holds a link to it?
p.s.
a href="somepage.html" target="_self"
didn't help

Using
a onclick="window.location.href = 'http://www.whatever.com/'"
is an option ?

Related

How do you click a button in a browser popup window

I'm new to using Watir and have a problem. Within my browser page there is an option to add a note. This brings up a window within the browser which has the following id:
span id="ui-id-2" class="ui-dialog-title">Add Note</span
I can't work out how to use the controls within this window such as the 'Save' button as Watir doesn't seem to recognise either the window or the controls
So if I wanted to use same type of Save button within the main browser it would be fine; I'd just use browser.button(:id=> "Save").click.
Trying to use it within the popup though won't work as Watir can't recognise it within the popup. Any ideas appreciated!

How to open the default popup from context menu in a chrome extension

I have developed a chrome extension that opens a popup when I click on the icon near the address bar. Everything works fine, however I want to add some functionality to it. So I thought I'd also add a context menu item so that the user can simply search for the highlighted word. I want the popup to showup when the user clicks on the item in the context menu(the default popup in the top right corner and not a new popup window or a new tab).
Can I have this functionality? If yes, how do I implement it?
You can't make the popup page show programmatically as if the user clicked it.
However, you can still have something display based on the background script / content menu click. There are 4 main options for your background script:
Open a new tab to the popup.html page
Programmatic injection of javascript to construct a popup-like dialog on the page
Content script message passing to do the same as above, using a running content-script.
Use the notifications API for a simple minimally stylized message to the user.
Options 2, 3, 4 will allow the user to stay on their tab without any navigation. The notifications API route is the simplest to use if you just want some quick notification to the user, and there are fewer security snags. 2 and 3 require more book-keeping, but you can make the dialog look like your popup.
There should be an API for it now (as in 2023)
https://developer.chrome.com/docs/extensions/reference/action/#method-openPopup
update: tried, but failed, there was a bug.
https://github.com/GoogleChrome/developer.chrome.com/issues/2602
hope they fix it soon.
I was looking for extensions that I have already been used, but forget its name. This extension opened up the result into Context Menu, without open new TAB or popup.
may be useful
https://developer.chrome.com/extensions/contextMenus

Google Blogger - Refresh page opened in a tab from another tab

Question like this has been asked in SO before, and it seems it is not possible to grab the URLs opened in other tabs.
If you write blogs, then you could have seen the Preview button, which on click opens the blog post in preview mode in a new tab and each time you clicks that button the preview page which was opened previously get refreshed.
May be my question is not constructive, but I was wondering how they are capturing the tab and refreshing the page.
What kind of stuff they are using? If anybody got the knowledge, if you share it would be very helpful.
Update:
Firebugging reveals that the Preview is a button:
Here is what Blogger uses for preview link for my post:
Preview
So what they do is use anchor tag with target attribute of a custom name (previewpost+postID).
When you first click on preview link, no tab will have this custom name, so new tab will be opened. If you click on it again, no new tab will be opened since the tab with that name already exist.
UPDATE:
Using button, this is probably accomplished the same way using javascript window.open(URL,name,specs,replace) method where name specifies the target attribute or the name of the window.

Yahoo UI the popup implementation with YAHOO.widget.Dialog

I used the Yahoo.widget.dialog to implement a popup window. Currently, it popups only on the page which is belongs. If I am working on the other (tab browser) pages. The popup window will be not seen.Could somebody supply some help for this ?Thanks
You could either switch to window.alert() or use window.open() to open a new pop-up window containing your content.
Neither one is something I'd personally want to experience, but those are your two options for opening a pop-up outside the page. Window.open will get caught by many pop-up blockers so you'll need to watch for that.

How is "Are you sure you want to navigate away from this page? " generated in browsers?

I have a page where I open a "modal window". It is really just a DIV, with an IFRAME inside, where I load another page. When I want to refresh the page, the browser pops up a window saying "Are you sure you want to navigate away from this page? Reloading this page will cause the modal window to disappear. Press OK to continue, or Cancel to stay on the current page."
How does this message get generated? How does the browser figure out that I have a modal window there, because I don't use any window.open() call from JavaScript? Is there any way to disable this behavior of the browser.
It may be body.onunload in the source of the page loaded in the IFRAME.
As the modal window is essentially an IFRAME, then when you close (or refresh) the main window, the browser knows it is killing that IFRAME, hence any body.onunload in that IFRAME fires.
If you have a function that handel onbeforeunload, automaticaly the Firefox message is generated.
you can disable it by returning null at the and of your handler.
This could be caused by some script modifying all off-site links to display this modal window, and then return true, or return false based upon your interaction with the modal window.
If you want to strip that behavior, you could remove all click events for external links.

Resources