title: Integrating elfinder with TinyMCE 4, "TypeError: parent.tinymce.activeEditor.windowManager.getParams is not a function
body: <p>I am still newbie to integrate elfinder and tinymce, i already follow tutorial in elfinder <a href="https://github.com/Studio-42/elFinder/wiki/Integration-with-TinyMCE-4.x" rel="nofollow">wiki</a></p>
  
  <p>in form.php in tinymce init already added file_browser_callback:elFinderBrowser:</p>
  
  <pre><code>tinyMCE.init({
                  mode : "exact",
                  elements : "txt_content",
                  theme : "advanced",
                  file_browser_callback : elFinderBrowser,
                  plugins : "advimage,advlink,media,contextmenu",
                  theme_advanced_buttons1_add_before : "newdocument,separator",
                  theme_advanced_buttons1_add : "fontselect,fontsizeselect",
                  theme_advanced_buttons2_add : "separator,forecolor,backcolor,liststyle",
                  theme_advanced_buttons2_add_before: "cut,copy,separator,",
                  theme_advanced_buttons3_add_before : "",
                  theme_advanced_buttons3_add : "media",
                  theme_advanced_toolbar_location : "top",
                  theme_advanced_toolbar_align : "left",
                  extended_valid_elements : "hr[class|width|size|noshade]",
  
                  paste_use_dialog : false,
                  theme_advanced_resizing : true,
                  theme_advanced_resize_horizontal : true,
                  apply_source_formatting : true,
                  force_br_newlines : true,
                  force_p_newlines : false,
                  relative_urls : true
          });
  </code></pre>
  
  <p>And also add function elFinderBrowser too:</p>
  
  <pre><code>function elFinderBrowser (field_name, url, type, win) {
    tinymce.activeEditor.windowManager.open({
      file: 'elfinder.html',// use an absolute path!
      title: 'elFinder 2.0',
      width: 900,  
      height: 450,
      resizable: 'yes',
      inline:true
    }, {
      setUrl: function (url) {
        win.document.getElementById(field_name).value = url;
      }
    });
    return false;
  }
  </code></pre>
  
  <p>elfinder.html </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
          &lt;title&gt;elFinder 2.0&lt;/title&gt;
  
          &lt;!-- jQuery and jQuery UI (REQUIRED) --&gt;
          &lt;link rel="stylesheet" type="text/css" media="screen" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css"&gt;
          &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"&gt;&lt;/script&gt;
  
          &lt;!-- elFinder CSS (REQUIRED) --&gt;
          &lt;link rel="stylesheet" type="text/css" media="screen" href="&lt;?php echo base_url() ?&gt;assets/vendor/elfinder/css/elfinder.min.css"&gt;
          &lt;link rel="stylesheet" type="text/css" media="screen" href="&lt;?php echo base_url() ?&gt;assets/vendor/elfinder/css/theme.css"&gt;
  
          &lt;!-- elFinder JS (REQUIRED) --&gt;
          &lt;script type="text/javascript" src="&lt;?php echo base_url() ?&gt;assets/vendor/elfinder/js/elfinder.min.js"&gt;&lt;/script&gt;
  
          &lt;!-- elFinder initialization (REQUIRED) --&gt;
  
      &lt;/head&gt;
      &lt;body&gt;
  
          &lt;!-- Element where elFinder will be created (REQUIRED) --&gt;
          &lt;div id="elfinder"&gt;&lt;/div&gt;
  
          &lt;script type="text/javascript" charset="utf-8"&gt;
              var FileBrowserDialogue = {
              init: function() {
                // Here goes your code for setting your custom things onLoad.
              },
              mySubmit: function (URL) {
                // pass selected file path to TinyMCE
                parent.tinymce.activeEditor.windowManager.getParams().setUrl(URL);
  
                // close popup window
                parent.tinymce.activeEditor.windowManager.close();
              }
            }
  
              $().ready(function() {
                  var elf = $('#elfinder').elfinder({
                      url : 'connector.php',
                      getFileCallback: function(file) { // editor callback
                          // file.url - commandsOptions.getfile.onlyURL = false (default)
                          // file     - commandsOptions.getfile.onlyURL = true
                          FileBrowserDialogue.mySubmit(file); // pass selected file path to TinyMCE 
                        }
                  }).elfinder('instance');
              });
          &lt;/script&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>but when i choose/select image in elfinder window, it show error in firegbug:</p>
  
  <blockquote>
    <p>"TypeError: parent.tinymce.activeEditor.windowManager.getParams is not
    a function"</p>
  </blockquote>
  
  <p>and it already driving me crazy,  any hints, guys?</p>