Avatart Thomas Verhoeven

Thomas Verhoeven

Peerobyte is a team of extremely enthusiastic specialists with a foothold in the European market via a Tier III Data Center in Frankfurt, Germany.

Peerobyte‘s roots are in server equipment because many of our engineers started their career in hardware infrastructure and its virtualization. That is why our team has expertise in building and developing cloud infrastructure to provide stable and flexible systems for every challenges of our clients.

answers & questions of Thomas Verhoeven

Learn more

How to execute JS before other scripts on a page in a Chrome Extension?

In my Chrome extension (manifest v3), I want my script to run first on the page and override some native window functions before any other scripts on the webpage can access them. I have contentscript.js set with run_at = document_start, and it successfully injects script.js into the page’s DOM. However, I can’t guarantee that my script will run before the webpage’s own scripts. I’ve tried different approaches, but none have worked. How can I solve this issue?
Gravatar — онлайн-сервис, позволяющий пользователям Интернета поддерживать постоянную картинку на большинстве сайтов.

Replied 1 year ago

4 replies

11 votes

How to execute JS before other scripts on a page in a Chrome Extension?

In my Chrome extension (manifest v3), I want my script to run first on the page and override some native window functions before any other scripts on the webpage can access them. I have contentscript.js set with run_at = document_start, and it successfully injects script.js into the page’s DOM. However, I can’t guarantee that my script will run before the webpage’s own scripts. I’ve tried different approaches, but none have worked. How can I solve this issue?
Gravatar — онлайн-сервис, позволяющий пользователям Интернета поддерживать постоянную картинку на большинстве сайтов.

Replied 1 year ago

4 replies

11 votes

Subscribe to our newsletter to get articles and news