kapouer / node-webkitgtk

webkitgtk bindings for :rocket: Node.js
MIT License
189 stars 13 forks source link

No property named "allow-file-access-from-file-urls" #37

Closed skerit closed 8 years ago

skerit commented 8 years ago

When trying to enable local file access you get this error:

(node:25711): GLib-GObject-WARNING **: g_object_set_valist: object class 'WebKitSettings' has no property named 'allow-file-access-from-file-urls'

I was browsing the webkitgtk documentation, and that seems to state the option is now "enable-file-access-from-file-uris"

kapouer commented 8 years ago

Which version of webkigtk are you building node-webkitgtk against ?

kapouer commented 8 years ago

Granted it's probably a bold typo... fixing it !

kapouer commented 8 years ago

Ugh, not a typo, just a mistake.

skerit commented 8 years ago

I installed libwebkit2gtk-4.0-dev on my Ubuntu 15.10 install, from the main repos.

I just edited it manually in the source and rebuilt it, but now I'm getting

(node:27247): GLib-GObject-WARNING **: g_object_set_valist:
object class 'WebKitSettings' has no property named 'enable-file-access-from-file-uris'

So even though it should be using the correct option according to the documentation, it's still not working over here :/

kapouer commented 8 years ago

ha damn i was right, doc was wrong, and i ran too quickly on this.

kapouer commented 8 years ago

ok the problem is that you're reading webkitgtk docs, while here we have webkit2gtk bindings: http://webkitgtk.org/reference/webkit2gtk/stable/WebKitSettings.html#WebKitSettings--allow-file-access-from-file-urls

skerit commented 8 years ago

Ah, that's good to know.

But even so, the original option also does not work. Any idea as to why?

kapouer commented 8 years ago

Because it's available since version 2.10 and you have 2.8.x.

skerit commented 8 years ago

Ah yes, at the bottom of the README.md it said version 2.8.x so I just went with that. By using the Webkit team unstable ppa, that part of the problem has now resolved.

I'm still getting "Not allowed to load local resource" inside the webkit window itself, but I'm guessing that's a bug on webkit2gtk's part.

kapouer commented 8 years ago

Also as you can see i just pushed something nicer for the next user.

skerit commented 8 years ago

Great, thanks :)

kapouer commented 8 years ago

"allow-file-access-from-file-urls" actually allows one to load file:// urls only if current location is also a file:// url.

kapouer commented 8 years ago

Not publishing to npm until you're done finding problems :)

skerit commented 8 years ago

Well I think they've all been resolved :) Creating an empty file and loading that works fine, allowing me to experiment with local files.

I've got a few extra requests regarding the "enable-mediasource" and "enable-media-stream" options, because the MediaSource api seems to be disabled by default. Shall I create a new issue for that?

kapouer commented 8 years ago

Yes, please do.