Vnote: Add option "Work Offline" (prevent downloading linked content)

Created on 28 Feb 2018  ·  23Comments  ·  Source: vnotex/vnote

Add as option for prevent (temporary) downloading linked inside .md files content (images, etc.) in reading mode in VNote.

  • [ ] "Work Offline"

Here is how it look in menu of web-browsers (Pale Moon, Firefox and other)
Work Offline

help wanted

All 23 comments

Hi, I am curious about the point to "work offline". Could you please elaborate the scenario and motivation?

Thanks!

My PC connected to Internet.

When I open VNote and work with Markdown files that has URL links to heavy images, VNote try download this images immediatly.

I won't download this images when work in VNote.

So, simple option for "Work Offline" needed here.

VNote will store inserted images locally. For now please use tools like proxifier to ban the Internet access of VNote. Since VNote uses QWebEngineProcess to load the web content, I am not sure how to disable the network access of it now. Will come back to it after finishing some more urgent tasks.

Thanks!

So, after discuss this issue on one of the LUG's websites, mostly all users want to see "Work Offline" option (enabled by default) for security reasons!

As I can see now, VNote not only immediately download linked content by URL in documents, but also each time on start try download latest versions of many JS-libs used by VNote for different options (such as MathJax, Flowchat.js, etc.) -- this is very wired behavior, so I also feel discomfort on such "hard coded" option of VNote.

Developers of Deepin (Linux distributive) already marked VNote as "non-free" package.

So, according all described above, there are few tasks for you:

TODO

  • [ ] Add option "Work Offline" (for temporary prevent download online content for documents where it linked)
  • [ ] Add settings for manage VNote dependency to JS-libraries (such as MathJax)

    • [ ] Option for control updating those libraries (set disable, manual or automatic JS-libraries updates)

    • [ ] Option for disable using JS-libraries and depended on it functions (disable temporary, for work session)

  • [ ] Add all required JS-librariess inside AppImage (so then no need download them from Internet each time when VNote start).
  • (some other small changes in settings)

This is minimal requirements to make VNote more safe and independent app.

@tamlok, current state on automatic downloading content including JS-scripts (and make it executable) from 3rd-parties websites by VNote without ask user firstly -- look like very good place for hijacking and is hole in VNote security... It's very important issue that should be solved for keep users privacy too!

Please, make VNote more secure by solving this tasks!

@Symbian9 Hi! VNote does NOT download JS-libs automatically. They are part of the source code of VNote (sub-modules). See vnote.cpp for the definitions.

For MathJax, there is also a config to specify your local script. See the FAQs. It is too big to be included in VNote's package.

For PlantUML, there is an option to use online server or local JAR. Privacy issue is warned in the option.

Both MathJax and PlantUML are disabled by default (I made MathJax enabled in 1.14, but I will turn it off in next version). So if you specify your local MathJax script and PlantUML JAR, there is no online script needed.

I do not know what is the criteria of the non-free from the perspective of Deepin. All the source codes of VNote are available and VNote depends on open source libraries which are given in the dependencies.

BTW, just curious, is Chromium free or non-free?

Thanks!

Thanks a lot, Huge gratitude for your work!
Glad that question with javascript issue resolved.
And I support to @Symbian9 with his idea and wishes and also interested in having the necessary option Work Offline in VNote.
Good luck!

@leonwolff Hi, I will try to add offline mode. As I said, VNote does not connect online automatically behide the sceen (even update check is executed manually). VNote only connects online if your notes contain the links to online media, for which the user should be responsible.

Thanks! :)

Both MathJax and PlantUML are disabled by default (I made MathJax enabled in 1.14, but I will turn it off in next version). So if you specify your local MathJax script and PlantUML JAR, there is no online script needed.

@tamlok, in v1.15 still NO option for specify local MathJax.

Here is screenshot from my PC with Internet access disabled:

MathJax offline

Here is screenshot from my PC with Internet access enabled:

MathJax settings & online

Why you not add same settings for MathJax (and other JavaScript-libs) yet, as you already did for PlantUML?

@Symbian9 Hi, VNote supports rich options in vnote.ini configuration file. I just do have enough time to expose all of them to the GUI interface. You could see the FQA for customizing the MathJax javascript. I will add a GUI option for that.

Thanks!

Hi, VNote supports rich options in vnote.ini configuration file.

You should add that info into FAQ, because currently there NO info about what file should be edited

How to specify custom MathJax script?

VNote supports a configuration [web]/mathjax_javascript which specifies the location of the MathJax and its configuration to use. The default value may look like this:

[web]
; Location and configuration for Mathjax
mathjax_javascript=https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML

You could download the MathJax (howto) and specify a local copy of the MathJax to use, like mathjax_javascript="/home/tamlok/Downloads/MathJax-2.7.2/MathJax.js?config=TeX-MML-AM_CHTML".

So into FAQ docs info that those option stored in file vnote.ini.

Also, when I look in default /home/<username>/.config/vnote/vnote.ini of VNote v1.15 i see only next in [web] subsection:

[web]
markdownit_opt=html, linkify, sub, sup

And there NO info about default MathJax location, that according FAQ should look like

; Location and configuration for Mathjax
mathjax_javascript=https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML

VNote does not output the default config out to the configuration folder. The defualt vnote.ini is embeded into the executable. You could check it out here. Only configurations which have customized by user will be written to the configuration folder.

I am still too busy to maintain the documentation. Will find time to add related description to it.

Thanks!

A config for Mathjax in the Settings dialog has been added. :)

Thanks!

A config for Mathjax in the Settings dialog has been added. :)

Nice.

Hope that next step is adding option "Prevent downloading linked web content"

VNote does not output the default config out to the configuration folder. The defualt vnote.ini is embeded into the executable

@tamlok, and nobody know what "default vnote.ini" file (embedded into the executable) include then... It's bad practice!

Highly recommend you export default config in configuration folder and only then read it from it!

@Symbian9 Indeed VNote does not load any web content from Internet except MathJax and PlantUML. I will add an option which will ban all other URLs.

@Symbian9 Hi, I have been struggling to find out the way to keep QWebEngineView from connecting to the Internet but fail to find anything useful. Hence sorry that I don't know how to make it work offline. I am happy to add it if anyone could show me the way.

And again, VNote does NOT download JS libs from network automatically except MathJax. For online PlantUML, it just make a GET request to the PlantUML server with all its data encoded.

Thanks!

Hence sorry that I don't know how to make it work offline. I am happy to add it if anyone could show me the way.

Any news on this task solving?

@Symbian9 No! As you know, a few people know VNote, fewer people follow VNote, fewer people participate in the development of VNote. Without the help, I still can not find out the solution. :)

First time seeing someone giving "task" and "to-do list" to an open-source-software developer on github.
What's wrong with the advice and suggestion? Unbelievable, sounds like in a company.

VNote will store inserted images locally. For now please use tools like proxifier to ban the Internet access of VNote. Since VNote uses QWebEngineProcess to load the web content, I am not sure how to disable the network access of it now.

Without the help, I still can not find out the solution. :)

OK, I have an idea with simple solution how prevent image loading. Will post details tomorrow.

Hi, I am curious about the point to "work offline". Could you please elaborate the scenario and motivation?

Portable computers in travel. You can end paying a lot of money just for using some MBs on a mobile connection in some foreign countries. I, sadly, have experience about that >_<. Some time ago I needed to send and receive some emails and IM messages so I couldn't turn off the Internet conection, but I didn't noticed that I had some open apps that were retrieving data from Internet frequently (mostly Ghostwriter, which hasn't an offline mode either -later I ditched it for Typora, which is closed source but permits to save pasted media from web pages in local- and cloud sync apps) so, what I thought it was going to be couple of dozen MBs or three was almost 120, and that, in countries were roaming may cost you like 3 €/MB is a quite noticeable amount.
So, turning on/off the internet connection for individual programs may be a rather useful feature in some cases. You will notice when you need to work from abroad and keep some comunication with your office :-|

Still do not know how to stop the traffic of QWebEngineView. Just close this issue here.

Still do not know how to stop the traffic of QWebEngineView. Just close this issue here.

@tamlok, What about this:

... a custom timer will stop the webpage loading and trigger loadFinished with ok=False

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FengJun1206 picture FengJun1206  ·  5Comments

nikita-moor picture nikita-moor  ·  5Comments

ANAT01 picture ANAT01  ·  4Comments

Lisuaki picture Lisuaki  ·  3Comments

stakaz picture stakaz  ·  4Comments