Is there a way to close Chrome Tab from within a html page?
What i search for is some javascript that will will say: Click here to close tab!
I think you can just use the window.close() function, just like you would when closing a popup window or a regular window:
http://www.javascript-coder.com/window-popup/javascript-window-close.phtml
Update: This no longer seems to work on newer versions of Chrome. However, opening a new window with:
Open window
and using
Close window
in foo.html works for me in Chrome 17. See also http://www.google.com/support/forum/p/Chrome/thread?tid=23c03746e3aa03f9&hl=en.
Related
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 can I add border-radius on chrome extension popup?
Also, can I add something like margin-top to the popup?
I got the answer from chromium developer:
Alas, that's not something you can control. Your popup content is
basically an iframe inside a window - you can't control the host
window
Chrome simply doesn't allow that.
Alternatives are, instead of the popup, opening a new window or injecting a content script in the active tab to display a modal.
In FireFox extensions, the Panel/Popup that opens on the Toolbar sizes itself outside the browser window, if needed, so that we see every populated elements in the panel. In Chrome however, the popup/panel is only drawn until the browser window's boundaries. So, if the user resizes the browser window small enough, you don't see the entire popup.
I checked the documentation and couldn't find anything. Is there anything that can be done to show the entire popup?
This seems to be OS-dependent (can be reproduced on Linux and Win7, but not Win10).
As an extension author, there is nothing you can do to control it, this is just how the browser renders its content. You could submit a bug report.
How to open new window without titlebar.
You can't (thankfully), at least not in common browsers in a standard web security context.
Every window opened by Javascript will have a titlebar. You only have control over whether scrollbars, statusbars, and toolbars are present in the opened window.
To get a headless "pop-up" effect, look into a library like LightBox that can do these sort of effects. You're not actually opening a new window according to the user-agent, but the behaviour is similar.
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.