Skip to content

Commit

Permalink
fix: no chrome.i18n in sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Jan 30, 2024
1 parent 87e868e commit 1d7a7d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/rsshub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,13 @@ export function getPageRSSHub(data: {
(parsed) => {
if (parsed) {
result.push({
title: formatBlank(rules[domain]._name ? chrome.i18n.getMessage('current') : '', rule[recog.handler].title),
title: formatBlank(rules[domain]._name ? 'Current' : '', rule[recog.handler].title),
url: '{rsshubDomain}' + parsed,
path: parsed,
});
} else {
result.push({
title: formatBlank(rules[domain]._name ? chrome.i18n.getMessage('current') : '', rule[recog.handler].title),
title: formatBlank(rules[domain]._name ? 'Current' : '', rule[recog.handler].title),
url: rule[recog.handler].docs,
isDocs: true,
});
Expand Down
3 changes: 3 additions & 0 deletions src/popup/RSSItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ function RSSItem({
if (type === 'currentPageRSSHub' && config.rsshubAccessControl.accessKey) {
url = `${url}?code=${new MD5().update(item.path + config.rsshubAccessControl.accessKey).digest('hex')}`
}
if (type === 'currentPageRSSHub') {
item.title = item.title.replace(/^Current/, chrome.i18n.getMessage('current'));
}
url = encodeURI(url);
const encodedUrl = encodeURIComponent(url);

Expand Down

0 comments on commit 1d7a7d0

Please sign in to comment.