  v8::Local<v8::Value> GetFrameForSelector(v8::Isolate* isolate,
                                           const std::string& selector) {
    content::RenderFrame* render_frame;
    if (!MaybeGetRenderFrame(isolate, "getFrameForSelector", &render_frame))
      return v8::Null(isolate);

    blink::WebElement element =
        render_frame->GetWebFrame()->GetDocument().QuerySelector(
            blink::WebString::FromUTF8(selector));
    if (element.IsNull())  // not found
      return v8::Null(isolate);

    blink::WebFrame* frame = blink::WebFrame::FromFrameOwnerElement(element);
    return CreateWebFrameRenderer(isolate, frame);
  }
  v8::Local<v8::Value> GetFrameForSelector(v8::Isolate* isolate,
                                           const std::string& selector) {
    content::RenderFrame* render_frame;
    if (!MaybeGetRenderFrame(isolate, "getFrameForSelector", &render_frame))
      return v8::Null(isolate);

    blink::WebElement element =
        render_frame->GetWebFrame()->GetDocument().QuerySelector(
            blink::WebString::FromUTF8(selector));
    if (element.IsNull())   
      return v8::Null(isolate);

    blink::WebFrame* frame = blink::WebFrame::FromFrameOwnerElement(element);
    return CreateWebFrameRenderer(isolate, frame);
  }