Skip to content

Commit 000bb90

Browse files
committed
Fix issues identified in GoogleChrome#1718 review
1 parent e10e8d2 commit 000bb90

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

functional-samples/sample.text-replacer/background.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ chrome.contextMenus.onClicked.addListener((info, tab) => {
3535
chrome.runtime.onMessage.addListener((message, ) => {
3636
switch (message.id) {
3737
case GET_REPLACEMENTS_MESSAGE_ID:
38-
return chrome.storage.sync.get(['patterns']);
38+
// Fall back to an empty array 'patterns' is not set
39+
return chrome.storage.sync.get({patterns: []});
3940

4041
case SET_REPLACEMENTS_MESSAGE_ID:
4142
return chrome.storage.sync.set({'patterns': message.data});

functional-samples/sample.text-replacer/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "Text Replacer",
33
"version": "1.0.0",
44
"manifest_version": 3,
5-
"description": "Replace any a line of text on a page with another line of text.",
5+
"description": "Replace any line of text on a page with another line of text.",
66
"icons": {
77
"32": "icons/icon32.png",
88
"48": "icons/icon48.png",

0 commit comments

Comments
 (0)