https://github.com/bttmly/waterhouse
EXPERIMENTAL: Extensible functions
https://github.com/bttmly/waterhouse
Last synced: 3 months ago
JSON representation
EXPERIMENTAL: Extensible functions
- Host: GitHub
- URL: https://github.com/bttmly/waterhouse
- Owner: bttmly
- Created: 2014-10-06T02:07:24.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-22T06:44:48.000Z (over 10 years ago)
- Last Synced: 2025-01-08T21:59:59.497Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 258 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# waterhouse [](https://travis-ci.org/nickb1080/waterhouse)
Proof-of-concept using and creating functions from another execution context.
Doesn't work in Chrome 37 since `eval` in `iframe` contexts [is broken](https://code.google.com/p/chromium/issues/detail?id=412173).
Works in 38+ and at least Node `0.10.32`
Here's a browser snippet to test support (`true` if supported, else `false`):
```js
(function testIFrameEval () {
var frame = document.createElement('iframe');
frame.style.display = 'none';
document.body.appendChild(frame);
var win = frame.contentWindow;
win.eval("var evalInFrame = true");
var result = win.evalInFrame;
document.body.removeChild(frame);
return !!result;
})();
```