Firefox: How can i get the position of my extension icon (browserAction) in the toolbar? - firefox-addon-webextensions

In FireFox, it is possible to customize the toolbar and move the browser action icon anywhere (like to the left of the address bar). How can I get this location in the extension code?

Related

Toolbar disappears when viewing PDF HTML5 WebView2

I am using a WebView2 control in a WPF application to show a PDF to the user
This is normally displayed with a nice little toolbar, all part and parcel of rendering a PDF in a WebView2 control, allowing the user to navigate to other pages, zoom in or out, rotate, etc.
However, we found that as the window gets a bit narrower at some point this toolbar simply disappears. Is there something we can do to stop this happening?
As the available space for the PDF toolbar shrinks the PDF toolbar shows fewer and fewer controls. This is also true in the browser. However, in the browser the minimum horizontal width of the browser window is a value at which the PDF toolbar is still visible.
I'm not sure if this behavior is by design or not. You can try opening a bug report about this on the WebView2 feedback repo.

How to inspect a Firefox WebExtension popup?

I'm trying to get a Google Chrome Extension to run as a Firefox Webextension. My original Problem is that the popup has no height. Besides that I could not for the life of me figure out how to inspect the DOM of the popup.
Btw the popup is just an HTML file and it is defined in browser_action.default_popup.
The bugs referenced in #minj's comment above are resolved in recent versions of Firefox. You can debug popups now. MDN explains it well; in brief...
enter about:debugging in the URL bar.
In the left-hand menu, click This Firefox (or This Nightly).
click Inspect next to your extension to open the "Extension Toolbox".
Check the option to "Disable Popup Auto-Hide" in the Extension Toolbox
then you select which HTML document you mean to debug (in this case it would be your popup HTML code) using the context switcher ("select an iframe as the currently targeted document")
After doing this, the popup stays on the screen and the inspector contains its HTML. I'm doing it now for the first time (in Firefox 49) and it's working well.
It's not currently possible since the popup closes automatically and there is no DOM view available. See bug 1236944 and bug 950936.
Popup sizing does not seem to work correctly in Firefox. There are a bunch of bugs related to it.

Can Silverlight hook into the browser's Edit > Cut/Copy/Paste menu items?

We have a Silverlight app that contains a grid, and we've added support for selecting multiple cells, copying their contents to the clipboard, and pasting back elsewhere in the grid. Currently the user invokes the Copy and Paste commands by either clicking a toolbar button inside our Silverlight app, or using the standard keyboard shortcuts, which we catch with a KeyDown event.
Is it possible to also hook into the browser's native Edit menu, and the Cut, Copy, Paste, etc. menu items that are built into the browser? For example, can the user drop down the Firefox button (or press Alt+E to drop down the classic Edit menu), click the Copy item in Firefox's menu, and have some sort of Copy command be relayed to the focused control in my Silverlight app? Same thing for the equivalent menus in IE, Chrome, Opera, etc.
I wouldn't be surprised if this can't be done, since even long-established browser plug-ins like Adobe Reader have their own buttons for copy/paste and even print, rather than hooking into the browser's native menus. But I've never programmed to a browser's plug-in model, so I don't know for sure what's possible.

Firefox Silverlight div Reloads

In my application, I have a div (iframe) that I am hiding/showing when a button is clicked, which displays the content of my .xap file. When I click the button to hide the div, I see the Silverlight frame disappear, and when I click the button to reshow the div, the Silverlight App reloads. Sometimes it'll appear blank too, but when I right-click the area, it has "Silverlight" listed in the context menu.
According to this post, the reloading is a FireFox bug.
Does anyone have a work around to the reload?
In IE, the div appears without having to reload the Silverlight App. I would like to get FireFox to have the same behavior. More over, I would like to stop FireFox from making the div content blank.

How to force IE7 toolbars to always show

I have the developer toolbar for IE7, which is great when I want to inspect the page layout in a fashion similar to the functionality of firebug for firefox.
However I am working with a web site that opens a new window with the toolbars disabled, and I cannot access my dev toolbar button! Is there a way to force IE7 to always show the toolbar?
I don't believe you can.
You can recover the navigation toolbar (back, forward, address bar, search box) in a chromeless window (one opened without navigation toolbar, menus, other toolbars) by hitting F11, then F11 again, but that still doesn't give you access to the IE Developer Toolbar.
What will sometimes work is to hit CTRL+N while the new, chromeless window has focus. Doing that will open a new chromed (toolbars, menus, etc) to the same URL as the chromeless window. The trick won't work very well if the chromeless window URL is the result of a POST, or does a GET that modifies state in some way on the server.
I imagine that this happens because the pop-up window is opened using a javascript window.open() call specifying not to have the toolbars on the new window?
One possibility is opening the page source, finding the javascript call that opens the window, and pasting it into the address bar, modifying it to not disable toolbars.
For example, if the call currently looks like:
window.open(url, "newWindow", "toolbar=no,width=500,...");
Edit the address bar to read something like:
javascript:window.open(url, "newWindow", "toolbar=yes,width=500,...");
When you push enter on that, it should pop up the window just the same, but with toolbars.
IE8 has the dev toolbar built-in, so you can always access it via F12. Consider upgrading?

Resources