Created
November 4, 2011 19:20
-
-
Save ericpedia/1340236 to your computer and use it in GitHub Desktop.
docraptor excluding scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myHTML = jQuery('html').clone(); | |
// I tried removing elements one by one, like this: | |
myHTML.find('script[src*="aloha"], link[href*="aloha"], .admin-only, script[src*="pro-player"], script[src*="proplayer"], script[src*="colorbox"], script[src*="sharethis"], script:contains("Aloha"), script:contains("colorbox"), script:contains("analytics"), script[src*="analytics"], script:contains("stLight"), style:contains("AdBlock"), style[style*="display: none !important"], script:contains("front-end-editor"), script:contains("thickbox"), link:contains("admin-bar"), #wpadminbar').remove(); | |
// another way to do it is to remove all scripts except a particular script, like this: | |
myHTML.find('script:not([src*="typekit"])').remove(); | |
// at one point I just removed all scripts, to see if that helped (not really) | |
myHTML.find('script').remove(); | |
// then put it into the content var, which gets sent to docraptor in document_content | |
content = "<!DOCTYPE html><html>" + myHTML.html() + "</html>"; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment