]> khamidou — GitHub mirrors - electron.git/commitdiff
Schemas should be registered early
authorCheng Zhao <zcbenz@gmail.com>
Wed, 22 Oct 2014 15:36:31 +0000 (23:36 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 22 Oct 2014 15:36:31 +0000 (23:36 +0800)
atom/renderer/api/atom_api_web_view.cc
atom/renderer/atom_renderer_client.cc

index 2cf4038e5a52624f473a462c317531225b8ef0db..9c2e1e4e0d8d68793274a2e505c06130f82de7c4 100644 (file)
@@ -8,7 +8,6 @@
 #include "native_mate/dictionary.h"
 #include "native_mate/object_template_builder.h"
 #include "third_party/WebKit/public/web/WebDocument.h"
-#include "third_party/WebKit/public/web/WebCustomElement.h"
 #include "third_party/WebKit/public/web/WebLocalFrame.h"
 #include "third_party/WebKit/public/web/WebView.h"
 
@@ -54,8 +53,6 @@ double WebView::GetZoomFactor() const {
 
 v8::Handle<v8::Value> WebView::RegisterEmbedderCustomElement(
     const base::string16& name, v8::Handle<v8::Object> options) {
-  blink::WebCustomElement::addEmbedderCustomElementName(name);
-
   auto document = blink::WebLocalFrame::frameForCurrentContext()->document();
   blink::WebExceptionCode ec = 0;
   return document.registerEmbedderCustomElement(name, options, ec);
index 751074165dd51ea027f4106ee378267db570f966..fa035f9bc4e7f5a039e94bbab392cc4b11deeace 100644 (file)
@@ -18,6 +18,7 @@
 #include "content/public/renderer/render_thread.h"
 #include "base/command_line.h"
 #include "native_mate/converter.h"
+#include "third_party/WebKit/public/web/WebCustomElement.h"
 #include "third_party/WebKit/public/web/WebDocument.h"
 #include "third_party/WebKit/public/web/WebFrame.h"
 #include "third_party/WebKit/public/web/WebKit.h"
@@ -99,6 +100,9 @@ AtomRendererClient::~AtomRendererClient() {
 void AtomRendererClient::WebKitInitialized() {
   EnableWebRuntimeFeatures();
 
+  blink::WebCustomElement::addEmbedderCustomElementName("webview");
+  blink::WebCustomElement::addEmbedderCustomElementName("browserplugin");
+
   if (!IsNodeBindingEnabled())
     return;