def new_tab(self, url):
        """Open new tab in current window"""
        if self._browser.driver.name == "firefox":
            self._browser.driver.get("about:config")
            self._browser.driver.execute_script(
                'document.getElementById("warningButton").click();',
            )
            self._browser.driver.execute_script(
                """
                Components.classes['@mozilla.org/preferences-service;1']
                    .getService(Components.interfaces.nsIPrefBranch)
                    .setIntPref('browser.link.open_newwindow', 3);
                """,
            )

        self._browser.driver.execute_script("window.open('%s', '_blank');" % url)

        if self._browser.driver.name == "firefox":
            self._browser.driver.execute_script(
                """
                Components.classes['@mozilla.org/preferences-service;1']
                    .getService(Components.interfaces.nsIPrefBranch)
                    .setIntPref('browser.link.open_newwindow', 2);
                """,
            )
            self._browser.driver.back()
Open new tab in current window
splinter/driver/webdriver/__init__.py