Question

I am very new to C++ and FireBreath. I was asked to create a plugin that actually need to add value into request header also need to handle response too. Can any please help me on this. I just created a sample plugin project but I did not get any idea where to start. Any help is highly appreciated.

Thanks, Ravi

Was it helpful?

Solution

There are two ways I could read your question. You won't like my answer regardless of which way you mean it, but here it is:

1) If you mean you want to add special headers to any arbitrary request that is made by the browser, you can't do this with a plugin; plugins are not aware of browsers and do not run unless called upon either by being added to a page using an object or embed tag or by being registered as the handler for a mimetype which is then loaded by the browser. In either case, you cannot modify the request headers anywhere. See also npapi.com/extensions

2) If you mean you have an existing plugin that is making HTTP requests through the browser using the BrowserStreams abstraction, you can't add special headers to this for the simple reason that the browser provides no mechanism for doing so. You could use a different library such as libcurl to make the request in which case you can do anything you want with it and the browser (for good or ill) will know nothing about it. In this case you'll lose any cookies, proxy, or authentication information that the browser may have known about.

If neither of those are the answer to your question, please clarify and we'll see what we can do to answer better.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top