I am building a Chrome extension that will present some stats in a popup window after clickig. I was wondering if it is possible to place a button/icon in the middle on the right edge of Chrome browser (not on the upper tab), so that after clicking a new tab/bar with statistics will slide from right/appear (height of a window should be equal to height of a browser window).
Is it possible? If not how about Chrome App ?
Thanks,
Tomasz
Related
I'm currently developing a chrome extension which needs to track the currently active tab, or the lack thereof. I have the following listeners running in the background:
chrome.windows.onFocusedChanged
chrome.windows.onCreated
chrome.idle.onStateChanged
chrome.tabs.onUpdated
chrome.tabs.onActivated
The issue is that when I have a chrome window full screened on my Mac, and three finger swipe away from it, chrome.windows.onFocusedChanged doesn't activate, which means that my extension believes that the last tab is still active even though the user has switched away from the chrome window. Is there a way to detect when a user switches away from a full screen chrome window on OS X?
Thanks!
I am trying to refer to window.top in my popup window here http://www.globalrph.com/davescripts/popup.htm
once in the popup I want to access the main window's document but window.top is returning undefined.
To access your popup's opener use.
window.opener
To access your opener's top (e.g your opener is in an iframe)
window.opener.top
Once at the opener window you want you can access the document to change its context, the location to manipulate the URL etc.
If you want to move your popup to the same top position as the opening browser window and centered horizontally to the size of the opening browser window, in modern browsers you can use:
window.moveTo(window.opener.screenX + (window.opener.outerWidth / 2) - (window.outerWidth / 2), window.opener.screenY)
outerWidth and screenX and screenY work in IE9 and above and in modern browsers.
moveTo has been around a long time.
In this case we're getting the left position of the opening browser window, calculating its center and subtracting half the width of the popup. That gives the center position. Then we use window.opener.screenY to get the top position of the opening browser window and setting the popup's top the same.
Many browsers have popup blockers turned on by default and will require the user to click a link to open a popup. I have this web application that opens a popup window to preview the results. A lot of web applications use a positioned div for dialogs. Not knowing your application, I really can't give advice as to the best approach to take.
I need to implement the following feature and make it work in Internet Explorer:
User clicks a link in the primary screen.
A popup will be opened in the secondary screen and in fullscreen mode.
Some requirements:
It must work in IE8 (and 9/10)
For simplicity, we can assume that the secondary screen is located on the right of the primary screen. Also, the resolution of the secondary screen is known.
Javascript is used, but VBScript would be also possible.
So far the prototype is working quite well
the popup is opened with window.open with left=screen.availWidth+1 -> will be opened in the secondary screen OK
the fullscreen mode is activated with Wscript.Shell sendKeys({F11}) trick. This has some random issues. Timing etc will make it fail sometimes.
There are couple of IE-specific problems that make the implementation much more difficult
screen.availWidth returns always the primary screen resolution. E.g. Firefox returns the right size for popups located in secondary screen. Otherwise I could mimic the fullscreen mode by positioning the popup to fill the secondary screen completely.
window.open() with "fullscreen=1" works too but it ALWAYS opens the popup in the primary screen. This happens even if I use timers to make it target to secondary screen. Also a temporary pop-up located in secondary screen does not help. Looks like the fs=1 will always open the window in the screen where the click originated.
And for clarity, this will be implemented for an intranet application and has valid and well justified reasons. There is no point to suggest to try another web browser.
Any ideas that has been proven to work are welcome!
I am debugging a Chrome Browser Extension in Chrome (Stable Version 21.0.1180.57 - NOT Chromium) on Linux Mint (with XFCE as my desktop environment).
When I click on the extension, the popup originating from it goes upward over the title bar rather than downward into the browser. This makes its contents unviewable without resizing or moving the window.
If, however, I comment out this line in the file, background.js:
chrome.browserAction.setPopup({"tabId":data.tabId, "popup":url})
the popup drops down into the browser window like it is supposed to (except it doesn't show our extension's page-specific content).
I tried to take a screenshot, but I couldn't figure how to do so with the popup open.
window.open() of javascript, it is working fine in other browsers, but in case of ie-8 it shows some error such as popup.
You're probably getting stopped by the pop-up blocker.
window.open ("http://www.location.com", "mywindow","status=1,toolbar=1");
The allowed parameters are as below
status The status bar at the bottom of the window.
toolbar The standard browser toolbar, with buttons such as Back and Forward.
location The Location entry field where you enter the URL.
menubar The menu bar of the window
directories The standard browser directory buttons, such as What’s New and What’s Cool
resizable Allow/Disallow the user to resize the window.
scrollbars Enable the scrollbars if the document is bigger than the window
height Specifies the height of the window in pixels. (example: height=’350′)
width Specifies the width of the window in pixels.
(Shamelessly copied from here)