diff --git a/dist/article/article.html b/dist/article/article.html index a69f14a..c8f6027 100644 --- a/dist/article/article.html +++ b/dist/article/article.html @@ -3,13 +3,13 @@ + content="default-src 'none'; script-src-elem 'sha256-HLvh6tC4kZKt81b6Yi9wjdyXvuwO6InxwRG96ZZjHrw='; img-src http://* https://*; style-src 'self' 'unsafe-inline'; frame-src http://* https://*; media-src http://* https://*"> Article
- + \ No newline at end of file diff --git a/dist/article/article.js b/dist/article/article.js index 4aa0c9d..2fb3f13 100644 --- a/dist/article/article.js +++ b/dist/article/article.js @@ -3,7 +3,7 @@ function get(name) { return decodeURIComponent(name[1]); } document.documentElement.style.fontSize = get("s") + "px" -let html = decodeURIComponent(window.atob(get("h"))) +let html = get("h") let domParser = new DOMParser() let dom = domParser.parseFromString(html, "text/html") let baseEl = dom.createElement('base') diff --git a/src/components/article.tsx b/src/components/article.tsx index a558bf1..092f762 100644 --- a/src/components/article.tsx +++ b/src/components/article.tsx @@ -180,11 +180,11 @@ class Article extends React.Component { } } - articleView = () => "article/article.html?h=" + window.btoa(encodeURIComponent(renderToString(<> + articleView = () => "article/article.html?h=" + encodeURIComponent(renderToString(<>

{this.props.item.title}

{this.props.item.date.toLocaleString(this.props.locale, {hour12: !this.props.locale.startsWith("zh")})}

- ))) + `&s=${this.state.fontSize}&u=${this.props.item.link}` + )) + `&s=${this.state.fontSize}&u=${this.props.item.link}` render = () => ( diff --git a/src/main/window.ts b/src/main/window.ts index 0157305..e575293 100644 --- a/src/main/window.ts +++ b/src/main/window.ts @@ -57,6 +57,7 @@ export class WindowManager { fullscreenable: false, show: false, webPreferences: { + sandbox: true, webviewTag: true, enableRemoteModule: false, contextIsolation: true, diff --git a/src/scripts/models/item.ts b/src/scripts/models/item.ts index affda7e..5e13fc3 100644 --- a/src/scripts/models/item.ts +++ b/src/scripts/models/item.ts @@ -177,7 +177,7 @@ export function fetchItems(background = false): AppThunk> { let promises = new Array>() const initState = getState() if (!initState.app.fetchingItems && !initState.app.syncing) { - await dispatch(syncWithService()) + await dispatch(syncWithService(background)) let timenow = new Date().getTime() let sources = Object.values(getState().sources).filter(s => { let last = s.lastFetched ? s.lastFetched.getTime() : 0