0

I am in the process of developing a web extension (for firefox) and use console.log a lot during the development process. I do not want my extension to be detected by the website itself, therefore my question:

Can js functionality of the website capture console.log output I generate from within a content script?

Thanks!

elfeck
  • 385
  • 1
  • 8
  • 1
    Please research your question before posting - in the interest of content quality, duplicate questions aren't permitted. Duplicate of [How to read from Chrome's console in JavaScript](https://stackoverflow.com/questions/19846078/how-to-read-from-chromes-console-in-javascript) – esqew May 13 '22 at 15:50
  • No. Content scripts are isolated. – wOxxOm May 13 '22 at 15:50
  • "*I do not want my extension to be detected by the website itself*" Dependent on the functionality and overall architecture of your extension, there are a few other ways that their presence can be detected. See: ad-blocking extension detection done by many major US news publications. – esqew May 13 '22 at 15:51
  • @esqew I found that question you linked but it does seem to provide an answer to the question "Getting console.log output from within JS" without talking about content scripts or web extensions at all, hence my question – elfeck May 13 '22 at 16:10
  • 2
    @elfeck In most all major browsers, the execution context of the content script is entirely separate from the page's it's operating on. Thus the page itself **cannot** modify the `console.log()` method in the context of the content script to read its outputs. In the absence of a security hole in this part of your user's browser, there should not be a way the page itself should be able to read the contents of your extensions console logs. – esqew May 13 '22 at 23:20
  • Thanks! It's difficult to find explicit info on that – elfeck May 16 '22 at 15:09

0 Answers0