Consider splitting WebExtension implementation into a separate WebKitWebExtension
Currently we have one WebKitWebExtension (web process extensions) that implements (a) internal Epiphany features that existed prior to WebExtension support, and (b) WebExtensions. But this is confusing because WebExtensions probably should not have access to any of Epiphany's preexisting features, and pages running normal web content should probably not have access to any WebExtension features. I wonder if we can split these into two separate WebKitWebExtensions, so that we don't have two unrelated functionalities crammed into the same class.
There are two ways we could do this:
- Two WebKitWebExtensions used by the same WebKitWebContext. Both shared objects would be installed in the same directory and so would get loaded into the same web processes.
- Two WebKitWebExtensions used by two (or more) WebKitWebContexts. Both shared objects would need to be installed into separate directories. Only one would be loaded at a time, so normal web content would render in the EphyEmbedShell's WebKitWebContext using the original WebKitWebExtension, while WebExtensions would run in one or more new WebKitWebContexts using the new WebExtension WebKitWebExtension.
The second approach would probably be nicer, if possible.