Skip to content
This repository was archived by the owner on Sep 28, 2023. It is now read-only.

Commit 19e6acc

Browse files
committed
Version update
1 parent 011ef1a commit 19e6acc

File tree

8 files changed

+341
-26
lines changed

8 files changed

+341
-26
lines changed

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "raven-reader",
33
"productName": "Raven Reader",
4-
"version": "1.0.58",
4+
"version": "1.0.59",
55
"author": "Hello Efficiency Inc. <[email protected]>",
66
"description": "Simple desktop RSS Reader",
77
"license": "MIT",
@@ -60,6 +60,7 @@
6060
"request": "^2.88.2",
6161
"rss-finder": "^2.1.4",
6262
"rss-parser": "^3.10.0",
63+
"sanitize-html": "^2.4.0",
6364
"sass-rem": "^3.0.0",
6465
"splitpanes": "^2.3.6",
6566
"ssri": "^8.0.1",
@@ -107,8 +108,6 @@
107108
"ssri": "^6.0.2",
108109
"jquery": "^3.6.0",
109110
"electron-icon-builder/**/yargs-parser": "13.1.2",
110-
"@postlight/mercury-parser/jquery": "3.5.0",
111-
"@postlight/mercury-parser/**/css-what": "5.0.1",
112111
"vue2-perfect-scrollbar/**/css-what": "5.0.1",
113112
"vue2-perfect-scrollbar/**/normalize-url": "4.5.1",
114113
"@vue/cli-service/**/css-what": "5.0.1",
Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,37 @@
1-
{"Connect Feedbin":"Connect Feedbin","Log into Feedbin":"Log into Feedbin","Connect Self-hosted (Google Reader API)":"Connect Self-hosted (Google Reader API)","Log into Self Hosted RSS Service":"Log into Self Hosted RSS Service","Enter username":"Enter username","Connect Fever":"Connect Fever","Log into Fever":"Log into Fever","No categories available":"No categories available","Feed in this categories would not be deleted":"Feed in this categories would not be deleted","Please select atleast one feed":"Please select atleast one feed","Title":"Title","Feed":"Feed","Articles":"Articles","Action":"Action","Unsubscribe":"Unsubscribe","Articles inside this feed would be deleted":"Articles inside this feed would be deleted","Category cannot be empty":{"":"Category cannot be empty."},"Category":"Category","Manage Categories":"Manage Categories","Manage Feeds":"Manage Feeds","Please subscribe to atleast one feed to add category":"Please subscribe to atleast one feed to add category","No feeds available":"No feeds available","Add new feed":"Add new feed","Disconnect Fever":"Disconnect Fever","Disconnect Self-hosted (Google Reader API)":"Disconnect Self-hosted (Google Reader API)","Copy link":"Copy link","Remove from favourite":"Remove from favourite","Edit Feedbin":"Edit Feedbin","Disconnect Feedbin":"Disconnect Feedbin","Disconnect pocket":"Disconnect pocket","Disconnect Instapaper":"Disconnect Instapaper"}
1+
{
2+
"Connect Feedbin": "Connect Feedbin",
3+
"Log into Feedbin": "Log into Feedbin",
4+
"Connect Self-hosted (Google Reader API)": "Connect Self-hosted (Google Reader API)",
5+
"Log into Self Hosted RSS Service": "Log into Self Hosted RSS Service",
6+
"Enter username": "Enter username",
7+
"Connect Fever": "Connect Fever",
8+
"Log into Fever": "Log into Fever",
9+
"No categories available": "No categories available",
10+
"Feed in this categories would not be deleted": "Feed in this categories would not be deleted",
11+
"Please select atleast one feed": "Please select atleast one feed",
12+
"Title": "Title",
13+
"Feed": "Feed",
14+
"Articles": "Articles",
15+
"Action": "Action",
16+
"Unsubscribe": "Unsubscribe",
17+
"Articles inside this feed would be deleted": "Articles inside this feed would be deleted",
18+
"Category cannot be empty": {
19+
"": "Category cannot be empty."
20+
},
21+
"Category": "Category",
22+
"Manage Categories": "Manage Categories",
23+
"Manage Feeds": "Manage Feeds",
24+
"Please subscribe to atleast one feed to add category": "Please subscribe to atleast one feed to add category",
25+
"No feeds available": "No feeds available",
26+
"Add new feed": "Add new feed",
27+
"Disconnect Fever": "Disconnect Fever",
28+
"Disconnect Self-hosted (Google Reader API)": "Disconnect Self-hosted (Google Reader API)",
29+
"Copy link": "Copy link",
30+
"Remove from favourite": "Remove from favourite",
31+
"Edit Feedbin": "Edit Feedbin",
32+
"Disconnect Feedbin": "Disconnect Feedbin",
33+
"Disconnect pocket": "Disconnect pocket",
34+
"Disconnect Instapaper": "Disconnect Instapaper",
35+
"Copy feed link": "Copy feed link",
36+
"Edit feed": "Edit feed"
37+
}

src/background.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ async function createWindow () {
7171
// Use pluginOptions.nodeIntegration, leave this alone
7272
// See nklayman.github.io/vue-cli-plugin-electron-builder/guide/security.html#node-integration for more info
7373
webviewTag: true,
74+
enableRemoteModule: false,
75+
contextIsolation: true,
76+
worldSafeExecuteJavaScript: true,
7477
nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION,
7578
preload: path.join(__dirname, 'preload.js'),
7679
disableBlinkFeatures: 'Auxclick'

src/bridge/sanitize.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import sanitizeHtml from 'sanitize-html'
2+
3+
export default {
4+
sanitizeHtml: (content) => {
5+
return sanitizeHtml(content, {
6+
allowedTags: [
7+
'address', 'article', 'aside', 'footer', 'header', 'h1', 'h2', 'h3', 'h4',
8+
'h5', 'h6', 'hgroup', 'main', 'nav', 'section', 'blockquote', 'dd', 'div',
9+
'dl', 'dt', 'figcaption', 'figure', 'hr', 'li', 'main', 'ol', 'p', 'pre',
10+
'ul', 'a', 'abbr', 'b', 'bdi', 'bdo', 'br', 'cite', 'code', 'data', 'dfn',
11+
'em', 'i', 'kbd', 'mark', 'q', 'rb', 'rp', 'rt', 'rtc', 'ruby', 's', 'samp',
12+
'small', 'span', 'strong', 'sub', 'sup', 'time', 'u', 'var', 'wbr', 'caption',
13+
'col', 'colgroup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'img',
14+
'iframe'
15+
]
16+
})
17+
}
18+
}

src/mixins/cheerio.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export default {
22
methods: {
33
cleanupContent (content) {
4+
// content = window.sanitize.sanitizeHtml(content)
45
const dom = new DOMParser()
56
const doc = dom.parseFromString(content, 'text/html')
67
doc.querySelectorAll('.enclosure').forEach(item => item.remove())

src/parsers/feed.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ export function ParseFeedPost (feed) {
7373
} else {
7474
item.media = null
7575
}
76+
item.content = window.sanitize.sanitizeHtml(item.content)
7677
item.cover = item['media:content'] ? item['media:content'].$.url : getCoverImage(item.content)
77-
item.contentSnippet = truncate(item.contentSnippet, 100)
78+
item.contentSnippet = window.sanitize.sanitizeHtml(truncate(item.contentSnippet, 100))
7879
item.favourite = false
7980
item.read = false
8081
item.keep_read = null

src/preload.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import feverService from './bridge/fever'
1212
import greaderService from './bridge/greader'
1313
import inoreaderService from './bridge/inoreader'
1414
import feedbinService from './bridge/feedbin'
15+
import sanitizeService from './bridge/sanitize'
1516
const backend = require('i18next-electron-fs-backend')
1617

1718
ipcRenderer.setMaxListeners(0)
@@ -58,6 +59,7 @@ contextBridge.exposeInMainWorld('fever', feverService)
5859
contextBridge.exposeInMainWorld('greader', greaderService)
5960
contextBridge.exposeInMainWorld('inoreader', inoreaderService)
6061
contextBridge.exposeInMainWorld('feedbin', feedbinService)
62+
contextBridge.exposeInMainWorld('sanitize', sanitizeService)
6163
contextBridge.exposeInMainWorld('api', {
6264
i18nextElectronBackend: backend.preloadBindings(ipcRenderer),
6365
ipcRendReceiveOnce: (channel, func) => {

0 commit comments

Comments
 (0)