![]() Impacted by the CSS that is already on the page. Since the code is running as part of the web page, the UI we generated can be More information on Web Accessible Resources Known issues we punted on CSS leaking If you do this, be sure to add the resource url to the web_accessible_resource in Since we also wanted to add some nice UIĮlements, we decided to put the monkey patch code and the UI related code into a script file, which the resourceUrl links to. There are several ways to add the code into the script tag. (document.head || document.documentElement).appendChild(s) Var s = document.createElement('script') I had to use () to create a tag injected on the website which would load the monkey patch The solution: Injected scriptĭue to the isolated context, I had to take a different approach to successfully monkey patch the website. To learn more about how execution environment works, see this video on content scripts. Meaning the monkey patch won’t have any effect on the open website. Webpage, which is where the AJAX calls are made. However, the code executed by executeScript() is executed in a different context than the code on the Chrome Extension Tabs API has a method to execute the code: executeScript(). With code ready for monkey patching, we have to execute it. This article explaining how to monkey patch. There are a few resources on the web such as Now, I can simply add addEventListener('load', event) to capture the response data.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |