| 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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 24 matching lines...) Expand all Loading... |
| 35 else | 35 else |
| 36 errorCallback(new Error("File doesn't exist")); | 36 errorCallback(new Error("File doesn't exist")); |
| 37 }); | 37 }); |
| 38 } | 38 } |
| 39 | 39 |
| 40 function saveFile(file, data, callback) | 40 function saveFile(file, data, callback) |
| 41 { | 41 { |
| 42 ext.storage.set( | 42 ext.storage.set( |
| 43 fileToKey(file), | 43 fileToKey(file), |
| 44 { | 44 { |
| 45 content: data, | 45 content: Array.from(data), |
| 46 lastModified: Date.now() | 46 lastModified: Date.now() |
| 47 }, | 47 }, |
| 48 callback | 48 callback |
| 49 ); | 49 ); |
| 50 } | 50 } |
| 51 | 51 |
| 52 exports.IO = | 52 exports.IO = |
| 53 { | 53 { |
| 54 resolveFilePath: function(path) | 54 resolveFilePath: function(path) |
| 55 { | 55 { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 { | 109 { |
| 110 callback(null, { | 110 callback(null, { |
| 111 exists: true, | 111 exists: true, |
| 112 lastModified: entry.lastModified | 112 lastModified: entry.lastModified |
| 113 }); | 113 }); |
| 114 } | 114 } |
| 115 | 115 |
| 116 loadFile(file, onLoaded, callback); | 116 loadFile(file, onLoaded, callback); |
| 117 } | 117 } |
| 118 }; | 118 }; |
| OLD | NEW |