Skip to content

Commit 7ef8eb4

Browse files
committed
Fix html detection
1 parent 8e9b5d1 commit 7ef8eb4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

demo_frame.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ module.exports = function(node){
6161
var clonedBody = this.contentDocument.body.cloneNode(true);
6262
var scripts = [].slice.call(clonedBody.getElementsByTagName("script"));
6363
scripts.forEach(function(script){
64-
if(!script.type || script.type.indexOf("javascript") >= 0) {
64+
if(!script.type || script.type.indexOf("javascript") === -1) {
6565
script.parentNode.removeChild(script);
6666
}
6767
});
@@ -80,7 +80,7 @@ module.exports = function(node){
8080
var scripts = [].slice.call(this.contentDocument.querySelectorAll("script"));
8181
// get the first one that is JS
8282
for(var i =0; i < scripts.length; i++){
83-
if(!scripts[i].type || (scripts[i].type.indexOf("javascript") === 0 &&
83+
if(!scripts[i].type || (scripts[i].type.indexOf("javascript") >= 0 &&
8484
!scripts[i].src)){
8585
source = scripts[i].innerHTML;
8686
break;

0 commit comments

Comments
 (0)