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 7048257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:52:11+00:00 2026-05-28T02:52:11+00:00

I am attempting to create a Chrome extension to help me understand Chrome’s webRequest

  • 0

I am attempting to create a Chrome extension to help me understand Chrome’s webRequest API by replicating what is done with this answer but without the experimental portion of the namespace, which is no longer needed since webRequest is now in Chrome’s trunk.

In my background page I have the code:

<!DOCTYPE html>
<html>
  <head>
  <script>
function interceptRequest(request) {
    return { redirectUrl: 'http://www.yahoo.com' }
}
chrome.webRequest.onBeforeRequest.addListener(interceptRequest, { urls: ['*://*.google.com/*'] }, ['blocking']);
  </script>
  </head><body></body>
</html>

In my manifest file I have:

{
  "name": "My Extension",
  "version": "0.1",
  "background_page": "background.html",
  "permissions" : [
     "webRequest",
     "webRequestBlocking",
     "*://*/*"
  ]
}

Based on the previously asked question, I should be forwarded to http://www.yahoo.com when I access https://www.google.com and my extension is loaded, however, https://www.google.com loads without any forwarding effect. What do I need to do in order to simply forward a user from one URI to another using the webRequest API in Chrome?

  • 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-28T02:52:12+00:00Added an answer on May 28, 2026 at 2:52 am

    Your url matching pattern isn’t correct. You simply need to add a trailing slash:

    {urls: ['https://www.google.com/']}
    

    Alternatively, you could use:
    ‘*://www.google.com/’ to match all protocols, ‘*://www.google.com/*’ to match beyond just the domain, and ‘*://*.google.com/*’ to match all subdomains, protocols and paths, etc.

    See:
    http://code.google.com/chrome/extensions/trunk/match_patterns.html

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

Sidebar

Related Questions

I attempting to create custom tabs using this . But when I try to
I'm attempting to create a cascading dropdown based on the Knockout.js Cart example but
I've been attempting to debug this all morning but can't seem to find the
I am attempting to create some custom map routes but can't get it working
I am attempting to create a fixed step loop in my program, but for
This script is attempting to: create a new folder scan an InDesign document for
I'm attempting to create an xquery expression that will return selected nodes but will
I'm attempting to create a subpage but I'm running into the error mentioned in
While attempting to create a replacement tablespace for USER, I accidentally created a datafile
Im attempting to create a new operator :? on lists, which operates the same

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.