browser.omnibox.setDefaultSuggestion truncates the last character from input

RESOLVED DUPLICATE of bug 1332942

Status

defect
RESOLVED DUPLICATE of bug 1332942
2 years ago
11 months ago

People

(Reporter: olivier.debroqueville, Unassigned)

Tracking

57 Branch

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Reporter

Description

2 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:57.0) Gecko/20100101 Firefox/57.0
Build ID: 20171005195903

Steps to reproduce:

I used the following code in the background.js script for a webextension:

var i = 0;
// Update the suggestions whenever the input is changed
browser.omnibox.onInputChanged.addListener((input, suggest) => {
    console.log(i + "  " + input);
    if (input.indexOf(" ") > 0) {
        let suggestion = buildSuggestion(input);
        console.log(suggestion);
        if (suggestion.length === 1) {
            suggest(suggestion);
            browser.omnibox.setDefaultSuggestion({description: suggestion[0].description});
        }
    }
    i++;
});


Actual results:

browser.omnibox.setDefaultSuggestion({description: suggestion[0].description});
was systematically one character behind the first line rendered by suggest(suggestion);

The last character is truncated and doesn't appear in the default suggestion.


Expected results:

The description should be identical in both:
browser.omnibox.setDefaultSuggestion({description: suggestion[0].description});
and the first line of
suggest(suggestion);
Component: Untriaged → WebExtensions: Frontend
Product: Firefox → Toolkit

Comment 2

2 years ago
Thanks for spotting the duplicate Smile4ever.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1332942

Updated

11 months ago
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.