J.Jak
J.Jak

Reputation: 9

vala Webkit.WebView DOM manipulation

How can manipulate the DOM tree in webkit2gtk-4.0?

Old version:

WebKit.DOM.Document doc = get_dom_document();
WebKit.DOM.Element el = doc.create_element("div");
el.append_child(doc.create_text_node(color));
((WebKit.DOM.EventTarget) el).add_event_listener("dblclick", (Callback) on_div_clicked, false, this);
doc.body.insert_before(el, null);

compile:

valac --pkg gtk+-3.0 --pkg libsoup-2.4 --pkg webkitgtk-3.0

New version compile:

valac --pkg gtk+-3.0 --pkg webkit2gtk-4.0

error:

error: The symbol `DOM' could not be found
    private WebKit.DOM.Document get_document()

http://www.valadoc.org/#!api=webkit2gtk-web-extension-4.0/WebKit.DOM.Document How to add webkit2gtk-web-extension-4.0 ?

Upvotes: 1

Views: 393

Answers (1)

ptomato
ptomato

Reputation: 57920

Add --pkg webkit2gtk-web-extension-4.0 to your compile flags.

Upvotes: 1

Related Questions