Rather than guessing when the height might change by using a number
of different event listeners, use a ResizeObserver to get direct
notifications of any changes to the HTML element's size.
Move selection changed event listener into JS so it doesn't have to
cross the JS/native boundary twice.
Move sending remote load blocked from JS to the extension since we can
do that directly now and again so the JS/native boundary doesn't need
to be double-crossed again.
Define a vala-backed JS class in the extension and make that available
to pages when they are registered. Add some helper JS to PageState for
defining message sending functions. Listen for these in
Components.WebView and dispatch to the registered callback for it.
Update web extension to check for errors when invoking page state
methods and pass a message back if found. Check for this, decode and
throw a vala error in the WebView if found.
Use WebKitGTK UserMessage objects for invoking JS methods rather than
serialising to JS strings and running those. This is possibly slightly
less efficient, but removes the onus on serialising to and parsing from
JS and once switched over from message handlers to UserMessage objects
will be using a single uniform IPC interface for both.
Revert merge request GNOME/geary!374 for now since the shared process
model breaks old-style WebProcess message handler IPC.
This can be un-reverted when out JS is ported to the new Messages API
that is landing in WebKitGTK 2.28.
This reverts commit e4a5b85698, reversing
changes made to 66f6525480.
Now that a shared WebKitUserContentManager is shared between web views,
the old "load a JS file when remote resource loading is allowed" doesn't
work any more. Instead, set a variable on the frame's window object
in the web extension notified that a new page has been loaded, and
use that instead.