我复制了第一个演示,添加了我自己的自定义图标,没有别的。使用jpm run
进行测试,工作正常,按钮显示在导航栏中,可以自定义和移动,单击按钮可以按预期打开选项卡到mozilla.org,很棒。
jpm xpi
,安装会生成两条错误消息,与a similar question中提到的相同,但与该问题不同,该图标甚至不会显示在界面的任何位置。
但是,如果我退出然后使用-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
(或user.pref
)中提及有关图标显示位置的位置,但实际上并非如此。请注意下面的\"action-button--GUID-mozilla-link\"
。这个错误发生在每晚49.0a1,但不是每晚50.0a1,所以也许它已经修复了?
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有newElementCount = 173
而50.0a1有newElementCount = 0
。
自定义后 - &gt;在49.0a1中重置,演示操作按钮&#34;稍微出现在&#34;附加工具和功能&#34;中,但仅作为文本标签。图标不可见。该按钮无法正常移动,因为它将落入的位置的点击和拖动/悬停/索引是不正确的,并且当它被丢弃时,它会落地&#34;无处&#34;,从用户界面消失,但用户pref似乎仍然有效。