Question: If I call `console.log('something');` from the popup page, or any script included off that it works fine.

However as the background page is not directly run off the popup page it is not included in the console.

Is there a way that I can get `console.log()`'s in the background page to show up in the console for the popup page?

is there any way to, from the background page call a function in the popup page?

Answer: 
```
const log = chrome.extension.getBackgroundPage().console.log;
log('something')

```

Open log:

* Open: chrome://extensions/
* Details > Background page
In relation to the original question I'd like to add to the accepted answer by Mohamed Mansour that there is also a way to make this work the other way around:

You can access other extension pages (i.e. options page, popup page) from *within the background page/script* with the `chrome.extension.getViews()` call. As described [here](https://developer.chrome.com/extensions/background_pages).

```
 // overwrite the console object with the right one.
var optionsPage = (  chrome.extension.getViews()  
                 &&  (chrome.extension.getViews().length > 1)  ) 
                ? chrome.extension.getViews()[1] : null;

 // safety precaution.
if (optionsPage) {
  var console = optionsPage.console;
}

```