Chrome extension not loading EventListener

前端 未结 2 1930
轻奢々
轻奢々 2021-01-28 16:43

I\'ve been creating a chrome extension that splits my new tab pages into 2 frames so I can try to load 2 different URLs. Right now I\'ve started off simple, but I can\'t get the

2条回答
  •  广开言路
    2021-01-28 17:16

    In your manifest.json file, you should add a key, that indicates whenever to run your .js scripts.

    You should place it under "content_scripts" as following:

    {
    ...
        "content_scripts": [{
            "run_at": "document_end",
    ...
    

    "document_end" indicates that your code should run after the document, of the current tab, was loaded.

提交回复
热议问题