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-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 204 |
205 /** | 205 /** |
206 * Sets the `LogSystem` implementation used for logging (e.g. to handle | 206 * Sets the `LogSystem` implementation used for logging (e.g. to handle |
207 * `console.log()` calls from JavaScript). | 207 * `console.log()` calls from JavaScript). |
208 * Setting this is optional, the engine will use a `DefaultLogSystem` | 208 * Setting this is optional, the engine will use a `DefaultLogSystem` |
209 * instance by default, which might be sufficient. | 209 * instance by default, which might be sufficient. |
210 * @param The `LogSystem` instance to use. | 210 * @param The `LogSystem` instance to use. |
211 */ | 211 */ |
212 void SetLogSystem(LogSystemPtr val); | 212 void SetLogSystem(LogSystemPtr val); |
213 | 213 |
| 214 /** |
| 215 * Sets a global property that can be accessed by all the scripts. |
| 216 * @param name Name of the property to set. |
| 217 * @param value Value of the property to set. |
| 218 */ |
| 219 void SetGlobalProperty(const std::string& name, AdblockPlus::JsValuePtr valu
e); |
| 220 |
214 private: | 221 private: |
215 JsEngine(); | 222 JsEngine(); |
216 | 223 |
217 FileSystemPtr fileSystem; | 224 FileSystemPtr fileSystem; |
218 WebRequestPtr webRequest; | 225 WebRequestPtr webRequest; |
219 LogSystemPtr logSystem; | 226 LogSystemPtr logSystem; |
220 v8::Isolate* isolate; | 227 v8::Isolate* isolate; |
221 V8ValueHolder<v8::Context> context; | 228 V8ValueHolder<v8::Context> context; |
222 EventMap eventCallbacks; | 229 EventMap eventCallbacks; |
| 230 JsValuePtr globalJsObject; |
223 }; | 231 }; |
224 } | 232 } |
225 | 233 |
226 #endif | 234 #endif |
OLD | NEW |