I'm trying to read some data from HTML web page from specified web site, in my Chrome extension. I tried many scripts but not succeed, and now trying with following..
chrome.webRequest.onBeforeRequest.addListener(
function(details)
{
alert('ok');
alert( details.requestBody);
},
{
urls: ["https://www.thefreedictionary.com/test"]
},
['requestBody']
);
The scripts runs without error, but callback never fires. I tried with different url's, but none of them worked. The alert never shown.
Can anyone find what I'm doing wrong here?
I just want to read web page from background script. I'm interested to use solution including something like below to define UserAgent.
myHttpWebRequest.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)";//"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0";
Any help would be highly appreciated.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…