Skip to content

Commit

Permalink
Fix firefox omnibox
Browse files Browse the repository at this point in the history
  • Loading branch information
Rustem Mussabekov authored and Rustem Mussabekov committed Jun 3, 2019
1 parent a3e05d2 commit 3ced5f1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internals/buildversion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
461
465
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"build-firefox": "npm run source && export NODE_ENV=production | rm -r build/firefox 2> /dev/null | webpack --config internals/webpack.build.firefox.js",
"build-opera": "export NODE_ENV=production | rm -r build/opera 2> /dev/null | webpack --config internals/webpack.build.opera.js",
"build-all": "npm run build-chrome && npm run build-firefox && npm run build-opera",
"source": "zip -FSr -q -X source.zip internals pages src .babelrc package.json yarn.lock README.md",
"source": "zip -FSr -q -X build/source.zip internals pages src .babelrc package.json yarn.lock README.md",
"git": "git add . && git commit -a -m \"6.0\" && git push --set-upstream origin master"
},
"devDependencies": {
Expand Down
9 changes: 7 additions & 2 deletions src/background/omnibox.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ const Omnibox = {
text = (text||"").trim();

extension.omnibox.setDefaultSuggestion({
description: (text ? "<match>"+_.escape(text)+"</match>" : extension.i18n.getMessage("findBookmark"))
description: (
text ? (
__PLATFORM__!='firefox' ? "<match>"+_.escape(text)+"</match>" : 'Raindrop.io: ' + text
)
: extension.i18n.getMessage("findBookmark")
)
})

if (!text) return;
Expand All @@ -49,7 +54,7 @@ const Omnibox = {
var matched = search.highlight(_.escape(item.title+(item.description?". "+item.description:"")), sRegex);
items.push({
content: item.link,
description: (item.hideLink ? "" : "<url>"+search.highlight(_.escape(item.link), sRegex)+"</url> ")+matched
description: ( (item.hideLink || __PLATFORM__=='firefox') ? "" : "<url>"+search.highlight(_.escape(item.link), sRegex)+"</url> ")+matched
})
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/background/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const Search = {
},

highlight(text,searchRegex) {
if (!searchRegex)
if (!searchRegex || __PLATFORM__=='firefox')
return text;

var r = new RegExp(searchRegex,'gi');
Expand Down

0 comments on commit 3ced5f1

Please sign in to comment.