2

I'm using the chrome.experimental.webRequest.onBeforeRequest callback where I need to find the URL of the tab making the request before returning from onBeforeRequest.

This would usually be the referring URL in the HTTP request but I also want the URL where there is no referrer sent such as HTTPS to HTTP requests.

The only thing I found was chrome.tabs.get which is asynchronous.

What would be the best approach to get the tab URL before returning?

I have two ideas on solving this:

  1. Using something similar to ManualResetEvent, though this answer says it is not possible.
  2. Listen to some other event and record each tab URL in a local structure.
1
  • @DeependerSingla your comment does not make any sense, please explain where and why it matters here Commented Apr 24, 2014 at 10:42

1 Answer 1

1

I can't think of any good answer to this, except the local structure you offered, and perhaps also using Web Workers, but that seems like an overkill, even if possible.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.