Arabinda Nanda
Arabinda Nanda

Reputation: 209

how to handle net::ERR_INSECURE_RESPONSE programmatically

I get the net::ERR_INSECURE_RESPONSE when making an ajax call to https url. When i open that https url once in the browser and accept the certificate, i do not get that error. but i do not want to open that url in the browser and want my javascript catch the error net::ERR_INSECURE_RESPONSE.

I found one link (i.e. How to handle ERR_INSECURE_RESPONSE in Google Chrome extension) which actually not working.

Appreciate a lot if someone guide me in the right direction in how to handle this error programmatically. Did all possible searches in google with no luck.

Upvotes: 0

Views: 1385

Answers (1)

Emrys Myrooin
Emrys Myrooin

Reputation: 2231

I think you are using a Content Script. But Content script can't use all chrome API.

However, content scripts have some limitations. They cannot:

  1. Use chrome.* APIs, with the exception of:
    • extension (getURL , inIncognitoContext , lastError , onRequest , sendRequest)
    • i18n
    • runtime (connect , getManifest , getURL , id , onConnect , onMessage , sendMessage)
    • storage
  2. Use variables or functions defined by their extension's pages
  3. Use variables or functions defined by web pages or by other content scripts

So you can't use chrome.webRequest API in content script. chrome.webReqest is undefined like all other chrome API except the 4 previously listed.

More information in Chrome Documentation

Upvotes: 1

Related Questions