Skip to content

Commit

Permalink
Update 1.5.0
Browse files Browse the repository at this point in the history
- Updated version for release of TOC menu and emoji
- Tweaked use of Promise from storage.get()
- BTW no longer works in Chrome; it doesn't follow spec
  • Loading branch information
KeithLRobertson committed Mar 15, 2019
1 parent 89d8ff6 commit 7a3a288
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions ext/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ function addExtensionStylesheet(href, media) {

function addCustomStylesheet() {
var p = webext.storage.sync.get('custom_css')
p.then((storage) => {
return p.then((storage) => {
if ('custom_css' in storage) {
var style = document.createElement('style');
style.textContent = storage.custom_css;
document.head.appendChild(style);
}
});
return p;
}

function makeAnchor(node) {
Expand Down Expand Up @@ -319,11 +318,10 @@ if (body.childNodes.length === 1 &&
if (hash > 0) url = url.substr(0, hash); // Exclude fragment id from key.
var scrollPosKey = encodeURIComponent(url) + ".scrollPosition";

processMarkdown(textContent).then(() =>
addMarkdownViewerMenu().then(() =>
createHTMLSourceBlob()
)
)
processMarkdown(textContent)
.then(() => addMarkdownViewerMenu())
.then(() => createHTMLSourceBlob());

try {
window.scrollTo.apply(window, JSON.parse(sessionStorage[scrollPosKey] || '[0,0]'));
} catch(err) {}
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Markdown Viewer Webext",
"version": "1.4.0",
"version": "1.5.0",
"author": "Keith L Robertson",
"homepage_url": "https://github.com/KeithLRobertson/markdown-viewer",
"description": "Displays markdown documents beautified in your browser.",
Expand Down

0 comments on commit 7a3a288

Please sign in to comment.