Bug 1445909 Comment 8 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Currently, `browser.userScripts.onBeforeScript.addListener()`  `return` is `'undefined'`.

Adding a condition for continuing after `onBeforeScript` would be an idea. e.g.

```js
const result = browser.userScripts.onBeforeScript.addListener();
if (result !== false) {
  // inject 
}
```

Above would allow break in `onBeforeScript` e.g.

```js
browser.userScripts.onBeforeScript.addListener(script => {
  
  if (condition) {
    return false;
  }
  // ....
}
```
Adding a condition for continuing after `onBeforeScript` or an option to break it, would be an idea. e.g.

```js
browser.userScripts.onBeforeScript.addListener(script => {
  
  if (condition) {
    return false;
  }
  // ....
}
```

Back to Bug 1445909 Comment 8