# Is there a limit on number of content scripts I can run on a page?

**URL:** <https://discourse.mozilla.org/t/is-there-a-limit-on-number-of-content-scripts-i-can-run-on-a-page/57941>\
**Category:** Development\
**Created:** [April 14, 2020, 12:31pm UTC](https://discourse.mozilla.org/t/is-there-a-limit-on-number-of-content-scripts-i-can-run-on-a-page/57941 "2020-04-14T12:31:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lars\_Ejaas](https://avatars.discourse-cdn.com/v4/letter/l/d07c76/32.png) [@Lars\_Ejaas](https://discourse.mozilla.org/u/Lars_Ejaas)\
**Post date:** [April 14, 2020, 12:31pm UTC](https://discourse.mozilla.org/t/is-there-a-limit-on-number-of-content-scripts-i-can-run-on-a-page/57941/1 "2020-04-14T12:31:57Z")

</div>

Hi everybody

I am doing the last bug testing and optimization on a browser Extension before release and trying to do a shared codebase for both Chrome, Opera, Edge and Firefox.

So far everything is running well in all browsers besides Firefox.

I am struggleing to debug the issue, but found this post that could very well be related: “[Order of execution of content scripts in Mozilla web extension](https://discourse.mozilla.org/t/order-of-execution-of-content-scripts-in-mozilla-web-extension/14365/7)” I have a hard time getting Firefox to run all the content scripts I need. In the manifest I have this:

“content\_scripts”: [

{

```
"matches": ["<all_urls>", "http://*/*", "https://*/*"],

"all_frames": false,

"js": ["content.js", "purify.min.js", "gsap.min.js", "Draggable.min.js", "draggabilly.pkgd.js", "ispin_mod.js"],

"run_at" : "document_idle"

```

},

It seems like all 6 scripts aren’t excecuted like they should? I have tried changing the order of the scripts - but no luck! content.js is the script I have made, the 5 others are libraries I use for functionality.  
If I put content.js last it isn’t executed at all? If I didn’t know better I would think that there is a limit on number of content scripts I can load in Firefox???

Any help with debugging, alternative solutions or anything similar is highly appreciated - I am a bit stuck (so close to the target).

---

<div class="post-metadata">

**Author:** ![Lars\_Ejaas](https://avatars.discourse-cdn.com/v4/letter/l/d07c76/32.png) [@Lars\_Ejaas](https://discourse.mozilla.org/u/Lars_Ejaas)\
**Post date:** [April 15, 2020, 9:22am UTC](https://discourse.mozilla.org/t/is-there-a-limit-on-number-of-content-scripts-i-can-run-on-a-page/57941/2 "2020-04-15T09:22:18Z")

</div>

So, I have tried debugging this further: I added: "console.log(‘XXX is now running’).  
To all files to narrow down what was going on…

Google Chrome just runs all 6 files - no problem.

In Firefox it seems that the GSAP.min.js is blocking further reading of other files.  
I have tried changing the order of the scripts to a lot of different combinations.  
It starts reading the GSAP file, but no content script are loaded after GSAP no matter what place in the order the file is placed - in the list of files.

Any idea why this might be? GSAP is an animation library for those of you that do not know it ([https://greensock.com/gsap/](https://greensock.com/gsap/)).

I get no errors in the console?
