OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 15 matching lines...) Expand all Loading... |
26 // We need to require the geckodriver, | 26 // We need to require the geckodriver, |
27 // otherwise on Windows the geckodriver path is not added to process.env.PATH. | 27 // otherwise on Windows the geckodriver path is not added to process.env.PATH. |
28 require("geckodriver"); | 28 require("geckodriver"); |
29 | 29 |
30 exports.platform = "gecko"; | 30 exports.platform = "gecko"; |
31 exports.oldestCompatibleVersion = "57.0"; | 31 exports.oldestCompatibleVersion = "57.0"; |
32 exports.ensureBrowser = ensureFirefox; | 32 exports.ensureBrowser = ensureFirefox; |
33 | 33 |
34 exports.getDriver = function(browserBinary, devenvPath) | 34 exports.getDriver = function(browserBinary, devenvPath) |
35 { | 35 { |
36 let options = new firefox.Options(); | 36 let options = new firefox.Options().setBinary(browserBinary).headless(); |
37 options.setBinary(browserBinary); | |
38 options.headless(); | |
39 | |
40 let driver = new webdriver.Builder() | 37 let driver = new webdriver.Builder() |
41 .forBrowser("firefox") | 38 .forBrowser("firefox") |
42 .setFirefoxOptions(options) | 39 .setFirefoxOptions(options) |
43 .build(); | 40 .build(); |
44 | 41 |
45 let cmd = new Command("moz-install-web-ext") | 42 driver.execute(new Command("install addon") |
46 .setParameter("path", devenvPath) | 43 .setParameter("path", devenvPath) |
47 .setParameter("temporary", true); | 44 .setParameter("temporary", true)); |
48 | |
49 driver.getExecutor().defineCommand( | |
50 cmd.getName(), "POST", | |
51 "/session/:sessionId/moz/addon/install" | |
52 ); | |
53 driver.schedule(cmd, `installWebExt(${devenvPath})`); | |
54 | 45 |
55 return driver; | 46 return driver; |
56 }; | 47 }; |
OLD | NEW |