Closed JeanPierreFig closed 7 years ago
This probably is not a pywebview
issue. You seems to be accessing a local file at an absolute path, which is restricted by sandboxing for security reasons.
Can you show us the HTML your are trying to load?
Yeah That's what I thought, I was testing it first on a mac and it worked. I think the problem is that the raspberry pi Uses Chromium as it's base.
html = """
<!DOCTYPE html>
<html>
<head>
</head>
<style media="screen">
body{
background-color: black;
}
.center {
max-width: 100%;
max-height: 100%;
bottom: 0;
left: 0;
margin: auto;
overflow: auto;
position: fixed;
right: 0;
top: 0;
}
</style>
<body>
<img src="/data/" alt="HTML5 Icon" class="center">
</body>
</html>
""".replace('/data/', data)
This is the string that I am passing. data is file:///home/pi/images/imageName
interestingly if I pass the image file alone with out html then it works but I need the styling
First things first, GTK or QT?
Try the relative path instead
Also, have you tried saving the code in an .html
file and running it in a web browser in the same machine?
@JeanPierreFig Is this still relevant?
"Not allowed to load local resource"
On a Raspberry Pi I am trying to load an html page that just makes the background black and centers the image on screen, but I'm getting this error