def _insertJavascript(urlMatch, js):

    apps = appsRunning(['Safari', 'Google Chrome'])

    # urlMatch is a list that needs to be converted to applescript format
    # ["a", "b"] -> {"a", "b"}
    urlMatch = "{\"" + "\",\"".join(urlMatch) + "\"}"

    if apps['Google Chrome']:
        applescript(s1 % (urlMatch, js))

    if apps['Safari']:
        applescript(s2 % (urlMatch, js))
dataset/ETHPy150Open koenbok/Cactus/cactus/browser.py/_insertJavascript/original