Execute a javascript string in the context of the browser tab.
540130
def execute_javascript(self, *args, **kwargs):
		'''
		
		'''

		ret = self.__exec_js(*args, **kwargs)
		return ret
653160
function (out) {
            var cfg = this._cfg;
            var width = this._frame.innerWidth;
            var disabledOrReadonly = cfg.disabled || cfg.readOnly;
            var tabIndex = disabledOrReadonly ? '' : ' tabindex="' + this._calculateTabIndex() + '"';
            if (this._skinObj.simpleHTML) {
                var stringUtils = ariaUtilsString;
                var options = cfg.options;
                var selectedValue = cfg.value;
                /*
                 * The _ariaInput attribute is present so that pressing ENTER on this widget raises the onSubmit event
                 * of the fieldset:
                 */
                var html = ['<select', Aria.testMode ? ' id="' + this._domId + '_input"' : '',
                        (width > 0) ? ' style="width: ' + width + 'px;" ' : '', tabIndex,
                        disabledOrReadonly ? ' disabled="disabled"' : '', this._getAriaLabelMarkup(),
                        ' _ariaInput="1">'];

                for (var i = 0, l = options.length; i < l; i++) {
                    // string cast, otherwise encoding will fail
                    var optValue = '' + options[i].value;
                    html.push('<option value="', stringUtils.encodeForQuotedHTMLAttribute(optValue), '"', optValue == selectedValue
                            ? ' selected="selected"'
                            : '', '>', stringUtils.escapeHTML(options[i].label), '</option>');
                }

                html.push('</select>');

                out.write(html.join(''));
            } else {
                var report = this.controller.checkValue(cfg.value);
                var text = report.text;
                report.$dispose();
                // The _ariaInput attribute is present so that pressing ENTER on this widget raises the onSubmit event
                // of the fieldset:
                out.write(['<span', Aria.testMode ? ' id="' + this._domId + '_input"' : '', ' class="xSelect" style="',
                        (width > 0) ? 'width:' + width + 'px;' : '', '"', tabIndex, this._getAriaLabelMarkup(),
                        ' _ariaInput="1">', ariaUtilsString.escapeHTML(text), '&nbsp;</span>'].join(''));
                // the &nbsp; at the end of the label is useful to make sure there is always something in the line so
                // that the height does not change
            }

        }
432985
def eval_js(self, expr):
        """"""
        if not self.is_built():
            self._pending_js_eval.append(expr)
            return
        logger.log(5, "Evaluate Javascript: `%s`.", expr)
        out = self.page().mainFrame().evaluateJavaScript(expr)
        return _to_py(out)
706401
function reloadTabsMatchingUrl(url) {
  var patterns = [
    new MatchPattern(url),
    new MatchPattern(url + '#*')
  ];
  for each (var tab in tabs) {
    var matchesAny = false;
    for each (var pattern in patterns) {
      if (pattern.test(tab.url)) {
        matchesAny = true;
        break;
      }
    }
    if (matchesAny) {
      tab.reload();
    }
  }
}
1076911
def run_string(self, string, metadata=None):
        """"""
        token = Token(string, metadata)
        return [str(tkn) for tkn in self.run([token])]
153136
def Escape(self, string="", **_):
    """"""
    # Translate special escapes:
    self.stack[-1] += self.STRING_ESCAPES.get(string, string)
1201006
function (/*HTMLElement*/ obj, /*String*/ type, /*Function*/ fn, /*Object*/ context) {
		var id = TL.Util.stamp(fn),
			key = '_tl_' + type + id;

		if (obj[key]) {
			return;
		}

		var handler = function (e) {
			return fn.call(context || obj, e || TL.DomEvent._getEvent());
		};

		if (TL.Browser.touch && (type === 'dblclick') && this.addDoubleTapListener) {
			this.addDoubleTapListener(obj, handler, id);
		} else if ('addEventListener' in obj) {
			if (type === 'mousewheel') {
				obj.addEventListener('DOMMouseScroll', handler, false);
				obj.addEventListener(type, handler, false);
			} else if ((type === 'mouseenter') || (type === 'mouseleave')) {
				var originalHandler = handler,
					newType = (type === 'mouseenter' ? 'mouseover' : 'mouseout');
				handler = function (e) {
					if (!TL.DomEvent._checkMouse(obj, e)) {
						return;
					}
					return originalHandler(e);
				};
				obj.addEventListener(newType, handler, false);
			} else {
				obj.addEventListener(type, handler, false);
			}
		} else if ('attachEvent' in obj) {
			obj.attachEvent("on" + type, handler);
		}

		obj[key] = handler;
	}
815681
function() {
            var tabs = Dom.getChildren(this._tabParent),
                contentElements = Dom.getChildren(this._contentParent),
                activeIndex = this.get(ACTIVE_INDEX),
                tab,
                attr,
                active;

            for (var i = 0, len = tabs.length; i < len; ++i) {
                attr = {};
                
                if (contentElements[i]) {
                    attr.contentEl = contentElements[i];
                }

                tab = new YAHOO.widget.Tab(tabs[i], attr);
                this.addTab(tab);
                
                if (tab.hasClass(tab.ACTIVE_CLASSNAME) ) {
                    active = tab;
                }
            }
            if (activeIndex) {
                this.set(ACTIVE_TAB, this.getTab(activeIndex));
            } else {
                this._configs.activeTab.value = active; // dont invoke method
                this._configs.activeIndex.value = this.getTabIndex(active);
            }
        }
407265
def _update_gui_text_tabs(self):
        """"""
        for index, page in enumerate(self.pages):
            self.tabWidget.setTabText(index, "{} (Alt+&{}){}".format(page.text_tab, index+1, (" (changed)" if page.flag_changed else "")))
550972
function runHtmlCodeSniffer() {
			return new Promise((resolve, reject) => {
				window.HTMLCS.process(options.standard, window.document, error => {
					if (error) {
						return reject(error);
					}
					resolve(window.HTMLCS.getMessages());
				});
			});
		}
153361
function(tab) {
        var that = this;
        if(typeof tab === 'string') {
            that.url = tab;
        } else if($.isPlainObject(tab)) {
            $.extend(that, tab);
        }
        if(!that.id) {
            that.id = $.zui.uuid();
        }
        if(!that.type) {
            if(that.iframe) {
                that.type = 'iframe';
                that.url = that.url || that.iframe;
            } else if(that.ajax) {
                that.type = 'ajax';
                that.url = that.url || ($.isPlainObject(that.ajax) ? that.ajax.url : that.ajax);
            } else if(that.url) {
                that.type = tab.ajax ? 'ajax' : 'iframe';
            } else {
                that.type = 'custom';
            }
        }
        that.createTime = new Date().getTime();
        that.openTime = 0;
        that.onCreate && that.onCreate.call(that);
    }
1187834
def execute_command(self, request, command, frame):
        """"""
        return Response(frame.console.eval(command), mimetype="text/html")
922194
def run_marionette_script(script, chrome=False, async=False, host='localhost', port=2828):
    """"""
    m = DeviceHelper.getMarionette(host, port)
    m.start_session()
    if chrome:
        m.set_context(marionette.Marionette.CONTEXT_CHROME)
    if not async:
        result = m.execute_script(script)
    else:
        result = m.execute_async_script(script)
    m.delete_session()
    return result
415120
Object executeScript(String jsScript) {
    String jsScriptWithFunction = "(function (){" + jsScript + "})();";
    try {
      return jsScriptEngine.eval(jsScriptWithFunction);
    } catch (ScriptException e) {
      throw new org.molgenis.script.core.ScriptException(e);
    }
  }
698097
public String javascript(String text) {
        if (text == null || text.isEmpty()) {
            return text;
        }
        return StringEscapeUtils.escapeEcmaScript(text);
    }
120805
function() {
      if (common.inlinescripts.length > 0) {
        var script_text = '';
        for (var i = 0; i < common.inlinescripts.length; i++) {
          if (!common.inlinescripts[i] || typeof common.inlinescripts[i] == 'undefined') 
            continue;
          else
            script_text += common.inlinescripts[i] + '\n';
        }
        try {
          eval(script_text);
        } catch(e) {
          batch.callback(script_text);
        }
      }
    }
1059459
def inject(self):
        
        with open(self.script_url, "r", encoding="utf8") as f:
            self.selenium.execute_script(f.read())