Skip to content

Commit

Permalink
Simplify script tags removal (mozilla#762)
Browse files Browse the repository at this point in the history
  • Loading branch information
willrnch authored Jan 19, 2023
1 parent fde3594 commit 8ed98b1
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions Readability.js
Original file line number Diff line number Diff line change
Expand Up @@ -1642,12 +1642,7 @@ Readability.prototype = {
* @param Element
**/
_removeScripts: function(doc) {
this._removeNodes(this._getAllNodesWithTag(doc, ["script"]), function(scriptNode) {
scriptNode.nodeValue = "";
scriptNode.removeAttribute("src");
return true;
});
this._removeNodes(this._getAllNodesWithTag(doc, ["noscript"]));
this._removeNodes(this._getAllNodesWithTag(doc, ["script", "noscript"]));
},

/**
Expand Down

0 comments on commit 8ed98b1

Please sign in to comment.