我在开发浏览器套件,
利用 content script 来取得 HTML document 来注入一些 HTML elements
但是发现以下的 code 会注入到所有的 document,
包括页面中 iframe 的独立 HTML document:
```js
// @content_script.js
// 建立 HTML element
const elem = document.createElement('a');
elem.setAttribute('href', 'https://.....');
elem.innerHTML = 'ClickHere';
// 插入到 document.body 内
document.body.appendChild(elem);
```
以上 content script 代码会在每个 HTML document 加载时都会执行 (包括 iframe 内)
有什么方法能指加载到浏览器页面开的“根”HTML document 呢?