script: Ensure script is initialized before running script.

Fixes #14154
This commit is contained in:
Emilio Cobos Álvarez 2016-11-12 02:27:51 +01:00
parent d49840eeec
commit a7cee44f59
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 13 additions and 6 deletions

View file

@ -163,15 +163,17 @@ fn perform_platform_specific_initialization() {
#[cfg(not(target_os = "linux"))]
fn perform_platform_specific_initialization() {}
pub fn init_service_workers(sw_senders: SWManagerSenders) {
// Spawn the service worker manager passing the constellation sender
ServiceWorkerManager::spawn_manager(sw_senders);
}
#[allow(unsafe_code)]
pub fn init(sw_senders: SWManagerSenders) {
pub fn init() {
unsafe {
proxyhandler::init();
}
// Spawn the service worker manager passing the constellation sender
ServiceWorkerManager::spawn_manager(sw_senders);
// Create the global vtables used by the (generated) DOM
// bindings to implement JS proxies.
RegisterBindings::RegisterProxyHandlers();