mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
In order to simplify m-c code, move some in pdf.js
* move set/clear|Timeout/Interval and crackURL code in pdf.js * remove the "backdoor" in the proxy (used to dispatch event) and so return the dispatch function in the initializer * remove listeners if an error occured during sandbox initialization * add support for alert and prompt in the sandbox * add a function to eval in the global scope
This commit is contained in:
parent
3447f7c703
commit
8bff4f1ea9
14 changed files with 472 additions and 265 deletions
|
@ -14,18 +14,7 @@
|
|||
*/
|
||||
|
||||
class ProxyHandler {
|
||||
constructor(dispatchEventName) {
|
||||
this.dispatchEventName = dispatchEventName;
|
||||
}
|
||||
|
||||
get(obj, prop) {
|
||||
if (obj._isApp && prop === this.dispatchEventName) {
|
||||
// a backdoor to be able to call _dispatchEvent method
|
||||
// the value of 'dispatchEvent' is generated randomly
|
||||
// and injected in the code
|
||||
return obj._dispatchEvent.bind(obj);
|
||||
}
|
||||
|
||||
// script may add some properties to the object
|
||||
if (prop in obj._expandos) {
|
||||
const val = obj._expandos[prop];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue