-2

I am trying to get all elements of current page in chrome extension. manifest.json looks like the following:

{
    "content_scripts": [
        "matches": [
            "https://*/*"
        ],
        "js": [
            "backend/generalSites.js"
        ],
        "all_frames": true
    ]
}

When I am using document.all[0].outerHTML in the generalSites.js like the following, it only shows section and scirpt tags. What I really want to get is body elements.

console.log(document.all[0].outerHTML);

Could you help me?

wOxxOm
  • 65,848
  • 11
  • 132
  • 136

1 Answers1

0

Use the following command instead of document.all[0].outerHTML

document.body.getElementByTagName("*");