问题
I have the following declaration in my manifest.json
, following Google's instructions:
{
...
"chrome_settings_overrides": {
"search_provider": {
"name": "My Name",
"keyword": "My Keyword",
"favicon_url": "icon32.png",
"search_url": "http://example.com/Home/Search?keyword={searchTerms}",
"encoding": "UTF-8",
"is_default": true
}
},
...
}
However, I cannot load the manifest with that part at all (removing it will make it work). The message is receive is:
Failed to load extension from: D:\Chrome\SearchExtensions Empty dictionary for 'chrome_settings_overrides'.
What am I doing wrong? What is the proper way doing this?
回答1:
The documentation says about "favicon_url"
:
may only be omitted if
prepopulated_id
is set.
And "favicon_url"
must be a fully qualified http or https url according to chromium source code:
if (!CreateManifestURL(*overrides->search_provider->favicon_url)) {
*error = ...
.........................................
// CreateManifestURL function:
if (!manifest_url->is_valid() ||
!manifest_url->SchemeIsHTTPOrHTTPS())
return std::unique_ptr<GURL>(); // <<<< returns an empty value that sets the error
来源:https://stackoverflow.com/questions/39177401/cannot-use-chrome-settings-overrides-for-overriding-search-provider