Left: | ||
Right: |
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 fs.rmdirSync(dirPath); | 52 fs.rmdirSync(dirPath); |
53 } | 53 } |
54 catch (error) | 54 catch (error) |
55 { | 55 { |
56 console.error(error); | 56 console.error(error); |
57 } | 57 } |
58 } | 58 } |
59 | 59 |
60 function startChromium(chromiumPath) | 60 function startChromium(chromiumPath) |
61 { | 61 { |
62 fs.chmodSync(chromiumPath, fs.constants.S_IRWXU); | 62 fs.chmodSync(chromiumPath, 0o700); |
Sebastian Noack
2018/09/25 22:12:46
fs.constants.S_IRWXU is 0o700. This change has no
hub
2018/09/26 01:03:25
on Windows? I expect it to be undefined there.
Sebastian Noack
2018/09/26 01:10:51
Geo, can you confirm?
geo
2018/09/26 13:34:09
Well, it get's rid of the `fs.chmodSync` error. Ho
| |
63 | 63 |
64 let dataDir = fs.mkdtempSync(path.join(os.tmpdir(), "chromium-data")); | 64 let dataDir = fs.mkdtempSync(path.join(os.tmpdir(), "chromium-data")); |
65 let child = null; | 65 let child = null; |
66 return { | 66 return { |
67 kill: () => child && child.kill(), | 67 kill: () => child && child.kill(), |
68 done: new Promise((resolve, reject) => | 68 done: new Promise((resolve, reject) => |
69 { | 69 { |
70 child = childProcess.execFile(chromiumPath, [ | 70 child = childProcess.execFile(chromiumPath, [ |
71 "--headless", "--single-process", "--disable-gpu", "--no-sandbox", | 71 "--headless", "--single-process", "--disable-gpu", "--no-sandbox", |
72 "--allow-file-access-from-files", "--remote-debugging-port=9222", | 72 "--allow-file-access-from-files", "--remote-debugging-port=9222", |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
208 { | 208 { |
209 child.kill(); | 209 child.kill(); |
210 return result; | 210 return result; |
211 }).catch(error => | 211 }).catch(error => |
212 { | 212 { |
213 child.kill(); | 213 child.kill(); |
214 throw error; | 214 throw error; |
215 }); | 215 }); |
216 }); | 216 }); |
217 }; | 217 }; |
OLD | NEW |