Skip to content

Commit 941b473

Browse files
authored
Merge pull request #44 from Chris-Boyle/fix-hasAttribute-error
Conditionally check hasAttribute in the event the object isn't an element.
2 parents d424349 + d703525 commit 941b473

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

CONTRIBUTORS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Cerner Corporation
1010
- Supriti Yeotikar [@supritiy]
1111
- Cody Price [@dev-cprice]
1212
- Roxanne Calderon [@foxannefoxanne]
13+
- Yusuf Ali [@yusufali2205]
1314

1415
[@mhemesath]: https://github.com/mhemesath
1516
[@kafkahw]: https://github.com/kafkahw
@@ -21,3 +22,4 @@ Cerner Corporation
2122
[@supritiy]: https://github.com/supriticerner
2223
[@dev-cprice]: https://github.com/dev-cprice
2324
[@foxannefoxanne]: https://github.com/foxannefoxanne
25+
[@yusufali2205]: https://github.com/yusufali2205

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"clean": "rm -rf dist lib doc",
1818
"dev": "webpack-dev-server --config webpack.config.dev.js",
1919
"lint-js": "eslint 'src/**/*.js' --fix",
20+
"prepare": "npm run build-es5 && npm run build-webpack",
2021
"test": "mocha --compilers js:babel-core/register --recursive"
2122
},
2223
"dependencies": {

src/provider/application.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import logger from '../lib/logger';
66
import { getOffsetHeightToBody, calculateHeight, calculateWidth } from '../lib/dimension';
77
import MutationObserver from 'mutation-observer';
88

9-
109
/** Application class which represents an embedded application. */
1110
class Application extends EventEmitter {
1211
/**
@@ -273,7 +272,7 @@ class Application extends EventEmitter {
273272
const protocols = /^(tel|mailto|fax|sms|callto):/;
274273
const element = document.activeElement;
275274

276-
if (!element || !(element.hasAttribute('download') || protocols.test(element.href))) {
275+
if (!element || !(element.hasAttribute && element.hasAttribute('download') || protocols.test(element.href))) {
277276
this.JSONRPC.notification('unload');
278277
this.trigger('xfc.unload');
279278
}

src/provider/provider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class Provider {
66
const enforceSecurity = config.secret || config.acls.some((x) => x !== '*');
77

88
// Set hidden attribute with script if not present and security is being enforced
9-
if (enforceSecurity && window.self !== window.top && !document.documentElement.hasAttribute('hidden')) {
9+
if (enforceSecurity && window.self !== window.top && !(document.documentElement.hasAttribute && document.documentElement.hasAttribute('hidden'))) {
1010
document.documentElement.setAttribute('hidden', null);
1111

1212
// WARNING: Setting hidden attribute with script can be countered by

0 commit comments

Comments
 (0)