mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 852962 - Bad optionsURL will show 'options' header but no options r=margaret
This commit is contained in:
parent
fa1c295631
commit
100f42a912
@ -328,22 +328,28 @@ var Addons = {
|
||||
if (xhr.responseXML) {
|
||||
// Only allow <setting> for now
|
||||
let settings = xhr.responseXML.querySelectorAll(":root > setting");
|
||||
for (let i = 0; i < settings.length; i++) {
|
||||
var setting = settings[i];
|
||||
var desc = stripTextNodes(setting).trim();
|
||||
if (!setting.hasAttribute("desc"))
|
||||
setting.setAttribute("desc", desc);
|
||||
box.appendChild(setting);
|
||||
if (settings.length > 0) {
|
||||
for (let i = 0; i < settings.length; i++) {
|
||||
var setting = settings[i];
|
||||
var desc = stripTextNodes(setting).trim();
|
||||
if (!setting.hasAttribute("desc"))
|
||||
setting.setAttribute("desc", desc);
|
||||
box.appendChild(setting);
|
||||
}
|
||||
// Send an event so add-ons can prepopulate any non-preference based
|
||||
// settings
|
||||
let event = document.createEvent("Events");
|
||||
event.initEvent("AddonOptionsLoad", true, false);
|
||||
window.dispatchEvent(event);
|
||||
|
||||
// Also send a notification to match the behavior of desktop Firefox
|
||||
let id = aListItem.getAttribute("addonID");
|
||||
Services.obs.notifyObservers(document, AddonManager.OPTIONS_NOTIFICATION_DISPLAYED, id);
|
||||
} else {
|
||||
// No options, so hide the header and reset the list item
|
||||
detailItem.setAttribute("optionsURL", "");
|
||||
aListItem.setAttribute("optionsURL", "");
|
||||
}
|
||||
// Send an event so add-ons can prepopulate any non-preference based
|
||||
// settings
|
||||
let event = document.createEvent("Events");
|
||||
event.initEvent("AddonOptionsLoad", true, false);
|
||||
window.dispatchEvent(event);
|
||||
|
||||
// Also send a notification to match the behavior of desktop Firefox
|
||||
let id = aListItem.getAttribute("addonID");
|
||||
Services.obs.notifyObservers(document, AddonManager.OPTIONS_NOTIFICATION_DISPLAYED, id);
|
||||
}
|
||||
} catch (e) { }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user