omnibox.setDefaultSuggestion(...) is delayed by one keystroke
Categories
(Core :: Widget: Gtk, defect)
Tracking
()
People
(Reporter: lani.julian.wagner+bugzilla, Unassigned)
Details
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:123.0) Gecko/20100101 Firefox/123.0
Steps to reproduce:
I'm working on an add-on that uses the omnibox. I want to update the default suggestion using omnibox.setDefaultSuggestion on every keystroke.
Minimal working example:
manifest.json
"manifest_version": 3,
"name": "ominbox test",
"description": "Firefox Add-On to test omnibox implementation",
"version": "1.0",
"omnibox": {
"keyword": "test"
},
"background": {
"scripts": ["service-worker.js"],
"type": "module"
},
"permissions": [
"tabs"
]
}
service-worker.js
browser.omnibox.setDefaultSuggestion({description: "defaultSuggesion"});
browser.omnibox.onInputChanged.addListener((text, suggest) => {
browser.omnibox.setDefaultSuggestion({description: text});
});
Actual results:
When I start typing after the omnibox keyword the default suggestion is always delayed by one keystroke. For example if I type test this into the address bar (test is the omnibox keyword here) then the default suggestion is thi instead of this.
I can tell that the omnibox.onInputChanged listener is called as expected as soon as a keystroke happens by introducing a simple console.log.
Expected results:
When I start typing after the omnibox keyword the default suggestion should directly reflect what I entered.
I would be interested in fixing this myself as long as I can figure out how to create a PR and someone tells me where to find the code for this.
Comment 2•1 year ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Updated•1 year ago
|
Description
•