File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -90,11 +90,14 @@ limitations under the License.
90
90
inlineImages ( doc . getElementsByTagName ( 'img' ) ) ;
91
91
92
92
var copy = doc . cloneNode ( true ) ;
93
- forEach ( copy . querySelectorAll ( 'cxx-publish-button' ) , function ( node ) {
94
- node . remove ( ) ;
95
- } ) ;
96
- forEach ( copy . querySelectorAll ( 'script' ) , function ( node ) {
97
- node . remove ( ) ;
93
+
94
+ // Remove elements that run code or don't contribute to the appearance
95
+ // of the page.
96
+ forEach ( [ 'cxx-publish-button' , 'script' , 'link[rel=import]' ] ,
97
+ function ( selector ) {
98
+ forEach ( copy . querySelectorAll ( selector ) , function ( node ) {
99
+ node . remove ( ) ;
100
+ } ) ;
98
101
} ) ;
99
102
forEach ( copy . body . querySelectorAll ( '*' ) , function ( node ) {
100
103
if ( getComputedStyle ( node ) . display === 'none' ) {
You can’t perform that action at this time.
0 commit comments