我复制了第一个演示,添加了我自己的自定义图标,仅此而已。使用 进行测试jpm run
,工作正常,按钮出现在导航栏中,可以自定义和移动,单击按钮按预期打开 mozilla.org 的选项卡,很棒。
jpm xpi
,安装会生成两条错误消息,与类似问题中提到的相同,但与该问题不同的是,该图标甚至不会出现在界面中的任何位置。
但是,如果我退出然后用 重新启动浏览器-jsconsole
,我不会收到此错误消息,但仍然没有任何按钮出现在任何地方。
此错误消息令人困惑,因为它提到的所有内容都是低级的,与我输入的任何非常基本的高级代码无关。
[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIURI.hostPort]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: resource://gre/modules/PopupNotifications.jsm :: PopupNotifications_refreshPanel/< :: line 667" data: no]
PopupNotifications_refreshPanel/<()
PopupNotifications.jsm:667
forEach()
self-hosted
PopupNotifications_refreshPanel()
PopupNotifications.jsm:616
PopupNotifications_showPanel()
PopupNotifications.jsm:728
PopupNotifications_update()
PopupNotifications.jsm:844
PopupNotifications_show()
PopupNotifications.jsm:394
gXPInstallObserver.showInstallConfirmation()
browser-addons.js:206
gXPInstallObserver.observe/showNotification()
browser-addons.js:383
gXPInstallObserver.observe()
browser-addons.js:399
notifyObservers()
amWebInstallListener.js:51
Installer.prototype.checkAllDownloaded()
amWebInstallListener.js:171
Installer()
amWebInstallListener.js:81
extWebInstallListener.prototype.onWebInstallRequested()
amWebInstallListener.js:335
buildNextInstall()
extensions.js:1276
gViewController.commands.cmd_installFromFile.doCommand/buildNextInstall/<()
extensions.js:1286
safeCall()
AddonManager.jsm:179
AddonManagerInternal.getInstallForFile/<.nextObject/<()
AddonManager.jsm:1955
this.XPIProvider.getInstallForFile/<()
XPIProvider.jsm:3872
makeSafe/<()
XPIProvider.jsm:1982
AddonInstall.prototype.initLocalInstall/</<()
XPIProvider.jsm:5306
makeSafe/<()
XPIProviderUtils.js:168
completeAddon()
XPIProviderUtils.js:157
getAddon()
AddonRepository.jsm:583
this.AddonRepository.getCachedAddonByID<()
AddonRepository.jsm:595
next()
self-hosted
TaskImpl_run()
Task.jsm:319
TaskImpl()
Task.jsm:280
createAsyncFunction/asyncFunction()
Task.jsm:254
getRepositoryAddon()
XPIProviderUtils.js:159
this.XPIDatabase.getAddon/<()
XPIProviderUtils.js:1119
Handler.prototype.process()
Promise-backend.js:937
this.PromiseWalker.walkerLoop()
Promise-backend.js:816
bound ()
self-hosted
bound bound ()
self-hosted
(unknown)
[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIURI.hostPort]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: resource://gre/modules/PopupNotifications.jsm :: PopupNotifications_refreshPanel/< :: line 667" data: no]
PopupNotifications_refreshPanel/<()
PopupNotifications.jsm:667
forEach()
self-hosted
PopupNotifications_refreshPanel()
PopupNotifications.jsm:616
PopupNotifications_showPanel()
PopupNotifications.jsm:728
PopupNotifications_update()
PopupNotifications.jsm:844
PopupNotifications_show()
PopupNotifications.jsm:394
gXPInstallObserver.observe()
browser-addons.js:432
notifyObservers()
amWebInstallListener.js:51
Installer.prototype.checkAllInstalled()
amWebInstallListener.js:230
Installer.prototype.onInstallEnded()
amWebInstallListener.js:270
AddonManagerInternal.callInstallListeners()
AddonManager.jsm:1716
this.AddonManagerPrivate.callInstallListeners()
AddonManager.jsm:2976
AddonInstall.prototype.startInstall/<()
XPIProvider.jsm:6212
InterpretGeneratorResume()
self-hosted
next()
self-hosted
TaskImpl_run()
Task.jsm:319
bound TaskImpl_run()
self-hosted
Handler.prototype.process()
Promise-backend.js:937
this.PromiseWalker.walkerLoop()
Promise-backend.js:816
bound ()
self-hosted
bound bound ()
self-hosted
(unknown)
about:config
@ browser.uiCustomization.state
(或 in )中提到user.pref
了图标应该在哪里,但实际上并不存在。请注意\"action-button--GUID-mozilla-link\"
以下。这个错误发生在 49.0a1 nightly 中,但不在 50.0a1 nightly 中,所以也许它已修复?
user_pref("browser.uiCustomization.state", "{\"placements\":{\"PanelUI-contents\":[\"edit-controls\",\"zoom-controls\",\"new-window-button\",\"e10s-button\",\"privatebrowsing-button\",\"save-page-button\",\"print-button\",\"history-panelmenu\",\"fullscreen-button\",\"find-button\",\"preferences-button\",\"add-ons-button\",\"developer-button\",\"sync-button\",\"bookmarks-menu-button\",\"home-button\",\"loop-button\",\"pocket-button\"],\"addon-bar\":[\"addonbar-closebutton\",\"status-bar\"],\"PersonalToolbar\":[\"personal-bookmarks\"],\"nav-bar\":[\"urlbar-container\",\"search-container\",\"downloads-button\",\"action-button--GUID-mozilla-link\"],\"TabsToolbar\":[\"tabbrowser-tabs\",\"new-tab-button\",\"alltabs-button\"],\"toolbar-menubar\":[\"menubar-items\"]},\"seen\":[\"loop-button\",\"pocket-button\",\"developer-button\",\"action-button--GUID-mozilla-link\"],\"dirtyAreaCache\":[\"nav-bar\",\"PanelUI-contents\",\"addon-bar\",\"PersonalToolbar\",\"TabsToolbar\",\"toolbar-menubar\"],\"currentVersion\":6,\"newElementCount\":173}");
在比较 49.0a1 和 50.0a1 之后,确保所有按钮图标的顺序相同,唯一的区别是 49.0a1 hasnewElementCount = 173
和 50.0a1 has newElementCount = 0
。
在 49.0a1 中自定义 -> 重置后,演示操作按钮“出现”在“附加工具和功能”中,但仅作为文本标签。图标不可见。该按钮无法“正确”移动,因为单击和拖动/悬停/它所在位置的索引不正确,并且在放下时,它“无处”降落,从 UI 中消失,但用户偏好似乎仍然有效。