firefox addOn-SDK: is it possible to open a modal external dialog window? - firefox-addon-sdk

I use that in my FF addonSDK to open a new external window popup.
win = require('sdk/window/utils').openDialog({
features: Object.keys({
centerscreen: true,
resizable: true,
scrollbars: true
}).join() + ',width='+w+',height='+h+',top='+pos.top+',left='+pos.left,
name: "mysite"
});
Works fine except it reacts as a simple popup window.
I wish it could be a modal panel window (similar to chrome panel).
Can this be done ?

yes you can. you need to use "sdk/panel" high level API.
refer to this link for more examples: https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/panel

Related

Leaflet layer control open only on click

Is there any way to open leaflet layer control only when clicked?
By default, it expands/collapse when on mouseover/mouseout. I want to open only on click.
You can use a bit of jQuery to get this done.
Set the 'collapsed' option to false and instead, create a button to show/hide the layer control.
btn.onclick = function() {
$('.leaflet-control-layers').toggle();
}
jsFiddle:https://jsfiddle.net/jht7u28L/1/ (a basic example)
Stop propagation on mouse over solved it. I am using d3 here but It can be easily handled by plain javascript or by jQuery.
d3.select(".leaflet-control-layers-toggle").on("mouseover", function () {
//this will make sure that layer popup menu
//not opens when mouseover
d3.event.stopPropagation();
});

Firefox sdk - access popup opened

I'm currently working on a Firefox addon, and I was wondering if is there any way to access pop-up, in other words a window that was open using Javascript function .open().
If I access all tabs the popups are not there, if I access all windows the popups windows are not there.
//
var allWindows = window_utils.windows(null);
//
var tabs = require('sdk/tabs');
for (let tab of tabs)
console.log(tab.title);
If you know the popup's url you can use a PageMod to detect when it loads, its url, etc.

Bing map ajax v7 control does not show infoBox 'close' button

For some reason this property is ignored.
Below is my code, as you can see i don't use a custom html.
Any idea why?
edit: i'm using the BingTheme.
the reason i need this button is that for some reason sometimes the infoBox does not close automatically when clicking another place on the map
this.map.entities.push(new Microsoft.Maps.Infobox(currentLocation,
{
title: location.threatType,
description: layer.Options.InfoBoxText + "</br>IP: " + location.IP, pushpin: pin,
zIndex: 100,
showCloseButton: true
}));
The Bing Theme module overrides all styles to match the styles that are used by, now older, Bing Maps site. As such customizations, such as showing the close button are disabled. I, personally never liked this module and recommend not using it. You can create a lot more customizations using the control without this module.

appAPI.openURL Issue in Firefox and IE

I am facing a Issue in appAPI.openURL parameter popup.
I expected popup parameter will open my URL as popup window. but it is popping under the main window. which is not my requirement.
I need to open my window as popup (modal popup) but not as pop under.
this is how i am doing it
appAPI.openURL({
url: href,
where: "popup",
focus: false
});
Any help would be appreciated.
Opening a modal window/popup has limited support by browsers/JavaScript and is less likely to work/be supported cross browser.
The nearest cross browser option you can achieve is to specify the where property of appAPI.openURL as window to open a popup window that is not modal.
appAPI.openURL({
url: href,
where: "window",
focus: false
});
[Disclosure: I am a Crossrider employee]
appAPI.openURL({
url: href,
where: "window",
focus: true,
height:window.screen.availHeight,
width:window.screen.availWidth
});
This opens a popup window above my browser.

Open new browser windows in background using CoffeeScript

How can I open a new browser in the background?
I trying to use window.open, but the new windows always open with focus.
I tried to do:
popup = window.open(#pop_url, '', 'width=,height=,resizable=YES')
You would have to remove the focus from the new window using blur() and set the new focus to your parent window using focus():
popup = window.open(#pop_url, '', 'width=,height=,resizable=YES');
popup.blur();
window.focus();
But be aware since this method has been used in the past mainly for user unfriendly behavior or content this will be blocked my most popup blockers - even though this method is actually called popunder.