3

I am building a gtk desktop application. The main part of my views are HTML. So I make use of the Python implementation of Webkit. The problem is, that I cant include images, as Webkit does not allow to load images from local file system:

<img src="file://{{media_url}}_theme/media/img/eft.png"/>

=> This will cause a "Not allowed to load local resource".

Is there a way to load static files like images or css-files locally?

Toni
  • 31
  • 1

2 Answers2

0

You can use base64 to encode your images as texts that can be included in your html pages.

0

@Skami 18's answer seems like a good direction. Maybe then use a data URI to actually set the src attribute?

Matt Luongo
  • 14,371
  • 6
  • 53
  • 64