* src/client/components/client-web-view.vala (ClientWebView): Rename
members referring to inline resources to internal resources, update
call sites.
(ClientWebView::handle_cid_request,
ClientWebView::handle_internal_request): Rework to use new common
::handle_internal_response method.
* src/client/web-process/web-process-extension.vala: Permit by default
any geary, cid, or data URI request.
This makes debugging easier, since the URL will show up in the console,
Inspector and elsewhere, and the HTML message source, etc will appear in
the Inspector.
* src/client/components/client-web-view.vala
(ClientWebView::init_web_context): Rehitser new internal scheme, hook
it up to the new ::handle_internal_request handler for it.
(ClientWebView::load_html): Keep a reference to the HTML body so it can
be loaded via the URL scheme handler, make the second param optional
and if null, use the new internal URL for the body part. Update call
sites to avoid using the second param.
* src/client/web-process/web-process-extension.vala
(GearyWebExtension::on_send_request): Allow requests for the
internal URL scheme.
* bindings/vapi/javascriptcore-4.0.vapi: Make JS objects match their JSC
definitions: move JSValueFoo methods to JS.Value, etc. Update call
sites.
* src/client/util/util-webkit.vala: Move WebKit-specific common methods
from ClientWebView here. Update call sites.
* src/engine/util/util-js.vala: Move JSC-specific common methods from
ClientWebView and ComposerPageStateTest here. Update call sites.
* src/client/web-process/web-process-extension.vala: Check for and handle
exceptions when calling JS code.
* src/CMakeLists.txt: Add new source files, make WebKit VAPI generation
and engine compilation depend on JSC.
Add a "has_selection" param to avoid a second round-trip to the web
process to determine that.
* src/client/components/client-web-view.vala (ClientWebView): Add a
selection_changed signal, register a JS message handler for the JS
equivalent hook up firing the signal.
* src/client/web-process/web-process-extension.vala (GearyWebExtension):
Send a JS selectionChanged message when the page's selection changes.
* src/client/composer/composer-widget.vala,
src/client/conversation-viewer/conversation-email.vala,
src/client/conversation-viewer/conversation-message.vala: Uncomment
code that relied on the WK1 selection_changed signal, use signal param
rather than DOM calls.
* ui/client-web-view.js: Implement sending the selectionChanged message.
* src/client/components/client-web-view.vala (ClientWebView): Register
for new remoteImageLoadBlocked message from JS. Add new
::remote_image_load_blocked signal to notify when a remote image load
was blocked. Add ::allow_remote_image_loading and ::load_remote_images
methods to allow th app to manage image loading state.
* src/client/conversation-viewer/conversation-email.vala
(ConversationEmail): Determine up front whether the message view should
load remote images and flag that, rather than passing through the email
flag and the contact store.
* src/client/conversation-viewer/conversation-message.vala
(ConversationMessage): Rmeove contact_store and
always_load_remote_images properties and related code, just let the
parent email view advise whether remote images should be initially
loaded and act accordingly. Look up to ClientWebView signal and methods
to handle manual remote image loading management by the user. Remove
some obsolete code.
* src/client/web-process/web-process-extension.vala (GearyWebExtension):
Replace allow_prefix implementation for remote image management with
explicit signalling to/from the application via JavaScript.
* ui/client-web-view.js: Add a new PageState object, add props and method
to implement remote image loading management.
* ui/client-web-view-allow-remote-images.js: Monkeypatch to be used when
remote images should be loaded by default.
* ui/CMakeLists.txt: Include new JS file.
* src/client/conversation-viewer/conversation-web-view.vala,
src/client/web-process/util-conversation.vala,
src/client/web-process/util-webkit.vala: Remove obsolete code.
* src/client/web-process/web-process-extension.vala
(GearyWebExtension::GearyWebExtension): Set the allow_prefix here,
since this is where we need to make the decision. Hook up to the
page-created and subsequently the send-request signals.
(GearyWebExtension::on_send_request): Always allow data and cid
requests through, only allow remote requests through if they have the
allow prefix.
(random_string): Moved here from util-random so we can call it.
* src/client/components/client-web-view.vala
(ClientWebView::allow_prefix): Keep this here for now, but its value
still needs to be fetched from the extension.
(ClientWebView::on_resource_load_started): Removed, the policy needs to
be set in the extension to actually work.
* src/CMakeLists.txt: Pass the build dir through to the application so it
can work out where to find the extension when running from the source
tree. Build geary-static as reloacatable so we can link it with the
extension. Actually link geary-static into the extension and install it.
* src/client/application/geary-application.vala
(GearyApplication::get_web_extensions_dir): New method that determines
where the web extension lib is to be found.
* src/client/application/geary-controller.vala
(GearyController::open_async): Set the extension dir on the WebContext,
and pass through logging config to the extension.
* src/client/web-process/web-process-extension.vala: Add a
GearyWebExtension extension object, create it on init and init logging.
Replace StylishWebView with ClientWebView, to act as a common base class
for the composer, conversation and other uses of web views.
Introduce a ComposerWebView that replaces WebviewEditFixer and extends
ClientWebView, and adds (dummy for now) methods for ComposerWidget to
call. Simiarly, make ConversationWebView extend ClientWebView, add dummy
calls to support the conversation viewer classes. Move common code from
both into ClientWebView.
Add a web-process library, unused other than for compile-time checking,
and move all client functions and methods involving DOM objects into util
classes there.
Bug 728002