Unlike in V5.6β : How to use an external browser with the open method I’d like to create a new Inkdrop owned browser window so I can transform the content of the current note and render it into this new window. I can’t seem to figure out a way to do this using the electron API but maybe I’m missing something?
For context see Create “render current document”
After a bit more searching, I found that
inkdrop.remote exists and can be used to create a new window and display content.
Note: you cannot interact directly with the DOM of this new window and must tell it which URL to navigate to. Luckily you can set data in the url as in the following example:
ink = require('inkdrop')
const win = new ink.remote.BrowserWindow()
There should also be ways to do this using IPC calls, but I am not familiar with them - if anyone has experience with these, please reply with more information.
Yeah, you can use
inkdrop.remote. It sounds scary to allow plugins to create BrowserWindow though
Maybe I should prohibit
remote entirely for security reasons.
Or, it’d be nice to have a permission mechanism for plugins so users can notice those sensitive actions in the future.
Currently, it is fully relied on your goodwill
Yes I share your viewpoint on that - a permission model for plugins might be worth it in the long run.
I think this use case warrants it, but I would be interested in hearing your thoughts on it (see link in first message)
For what it’s worth, I have a working prototype of this. I’m trying to communicate with users on what functionality they need.
Here’s a link to my implementation
I guess you can call
webContents.savePage to save the HTML to disk?
print are available in the