# How to override browser page content with WebExtensions

**URL:** <https://discourse.mozilla.org/t/how-to-override-browser-page-content-with-webextensions/8224>\
**Category:** Add-on Support\
**Created:** [April 21, 2016, 11:48am UTC](https://discourse.mozilla.org/t/how-to-override-browser-page-content-with-webextensions/8224 "2016-04-21T11:48:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johnz](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@Johnz](https://discourse.mozilla.org/u/Johnz)\
**Post date:** [April 21, 2016, 11:48am UTC](https://discourse.mozilla.org/t/how-to-override-browser-page-content-with-webextensions/8224/1 "2016-04-21T11:48:04Z")

</div>

It is possible to override default firefox pages with chrome.manifest.

For example:  
`override chrome://global/content/netError.xhtml chrome://offline/content/netError.xhtml`

How can I do this with package.json or with Javascript API for WebExtensions addon?

---

<div class="post-metadata">

**Author:** ![desktopd](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/desktopd/32/4520_2.png) [@desktopd](https://discourse.mozilla.org/u/desktopd)\
**Post date:** [April 21, 2016, 3:02pm UTC](https://discourse.mozilla.org/t/how-to-override-browser-page-content-with-webextensions/8224/2 "2016-04-21T15:02:06Z")

</div>

For WebExtensions (ones that have `manifest.json`), it is not expected that this is directly possible. Limited wrapped APIs for modifying more parts of Firefox could be added, I think.

For SDK-based add-ons (with `package.json`), you can use `chrome.manifest`. It may not be recommended, however.

---

<div class="post-metadata">

**Author:** ![Johnz](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@Johnz](https://discourse.mozilla.org/u/Johnz)\
**Post date:** [April 22, 2016, 1:28pm UTC](https://discourse.mozilla.org/t/how-to-override-browser-page-content-with-webextensions/8224/3 "2016-04-22T13:28:15Z")

</div>

Is there no possibility to access this webpage netError.xhtml page?

For example I did this and run jpm run command;

> pageWorker = require(“sdk/page-worker”).Page({  
> contentScript: “console.log(document.body.innerHTML);”,  
> contentURL: “chrome://global/content/netError.xhtml”  
> });

And the netError page content is printed in console.  
PageWorker is in regular intervals printing this value and I am not able to modify the content.
