Skip to content

Commit

Permalink
transfer screenshot note as html
Browse files Browse the repository at this point in the history
  • Loading branch information
pbek committed Dec 28, 2018
1 parent 1a1ddad commit 14d1d32
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
## 18.12.2
- added support to import pages as new note in QOwnNotes 18.12.9 and higher
- the html will be converted to markdown and images of the page will be downloaded (might take a while)
- added support to add a screenshot of the visible area as new note
- the screenshot will be added as `data:image` image as markdown
- added support to add a screenshot of the visible area as new note in QOwnNotes 18.12.9 and higher
- selected text will now be created as new note with newlines if possible

## 18.12.1
Expand Down
9 changes: 7 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,13 @@ function scrapeSelection(info, tab) {
function scrapePageScreenshot(info, tab) {
chrome.tabs.captureVisibleTab(function(dataUrl) {
const headline = tab.title;
const text = "<" + tab.url + ">\n\n![](" + dataUrl + ")";
const data = {type: "newNote", contentType: "markdown", headline: headline, text: text, pageUrl: info.pageUrl};

// const text = "<" + tab.url + ">\n\n![](" + dataUrl + ")";
// const data = {type: "newNote", contentType: "markdown", headline: headline, text: text, pageUrl: info.pageUrl};

const url = tab.url;
const text = "<a href=\"" + url + "\">" + url + "</a><br /><br /><img src=\"" + dataUrl + "\" />";
const data = {type: "newNote", contentType: "html", headline: headline, text: text, pageUrl: url};
WebSocketClient.sendData(data);
});
}
Expand Down

0 comments on commit 14d1d32

Please sign in to comment.