Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7183707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:02:46+00:00 2026-05-28T18:02:46+00:00

I am attempting to set up a chrome extension similar to http://code.google.com/chrome/extensions/trunk/samples.html#webrequest except that

  • 0

I am attempting to set up a chrome extension similar to http://code.google.com/chrome/extensions/trunk/samples.html#webrequest except that it would us the onErrorOccurred listener instead to redirect to a specific known page when the get request fails for any reason.

manifest.json:

{
  "name": "Custom Error",
  "version": "0.1",
  "description": "Redirect all navigation errors to specified location/file.",
  "permissions": [
    "webRequest",
    "tabs",
    "<all_urls>"
  ],
  "background": {
    "page": ["error_listener.html"]
  }
}

error_listener.html:

<!doctype html>
<script>
  chrome.webRequest.onErrorOccurred.addListener(
      function onErrorOccurred(details) {
        console.log('onBeforeRequest ', details.url);
        return { redirectUrl: 'http://www.google.com' }
      }, 
      {urls: ["<all_urls>"]}
      //{urls: ["http://*/*", "https://*/*"]}
  );
        //chrome.tabs.update(details.tabId, {url: "http://www.google.com", ['blocking']});
        //alert("what?");
</script>

The extension loads without any errors indicated yet the browser tab is not redirected. I have tried this using both Chrome 16 and Chrome 17; when using Chrome 16, I did change “chrome.webRequest” to “chrome.experimental.webRequest” and added “experimental” to the permissions list.

So far it seems like the problem is that while the extension appears to be loaded when looking at chrome://extensions, the files are not actually loaded–when using Developer Tools, I don’t see any reference to error_listener.html.

I have also tried running Chrome 17 with the following flags:

8611  25/01/12-11:22:05> google-chrome --restore-last-session 
--debug-on-start --log-level=0 --enable-logging 
--enable-extension-activity-logging --enable-extension-alerts 
--debug-plugin-loading --debug-print | tee > log1.txt

Obviously, I am just kind of poking around in the dark with that command line. Anyone have any clue as to how to get this working? Thanks in advance for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T18:02:48+00:00Added an answer on May 28, 2026 at 6:02 pm

    In Chrome 16, you should be using:

    "background_page": "background.html"
    

    rather than

    "background": {
        "page": ["error_listener.html"]
    }
    

    This fixes the problem with the background page not loading. It looks like this may have changed in the trunk docs compared to the current docs, and I’m not sure which version of Chrome starts implementing the new manifest.json format.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to use the code-behind (Page_Load or PreRender) to set a date-time
I am attempting to set the background color for a list box in code.
I am attempting to set an asp.net textbox to a SQL 2005 money data
I'm attempting to set up a symbol proxy using symproxy.dll from Debugging Tools for
I am attempting to set a value in a textarea field using jquery with
I'm attempting to set up basic logging to the windows event log in .net
I am attempting to set up my own project using a third party library
I have a Perl script that I'm attempting to set up using Perl Threads
Possible Duplicate: C# generic constraint for only integers Greets! I'm attempting to set up
I am attempting to run the following command in KornShell (ksh): set -A INDEXES

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.