diff --git a/manifest.json b/manifest.json index 0ab9ddc..f41db83 100644 --- a/manifest.json +++ b/manifest.json @@ -13,7 +13,7 @@ ], "content_scripts": [ { - "run_at": "document_end", + "run_at": "document_start", "matches": [ "https://github.com/*/*", "https://gist.github.com/*/*" diff --git a/src/content.js b/src/content.js index 0402752..2577837 100644 --- a/src/content.js +++ b/src/content.js @@ -1,6 +1,6 @@ // Inject empty style element for us to use const style = document.createElement('style'); -document.body.appendChild(style); +document.addEventListener('DOMContentLoaded', () => document.body.appendChild(style)); // Set tab size styles const setTabSizeStyles = size => style.innerHTML = `