I am trying to create extension for bypassing server authentication, install it on Firefox browser and pass the .xpi file while driver creation so that it gets invoked while login and the server authentication is bypassed. Facing error while installing the .xpi file on firefox. Error: "This add on could not be installed because it appears to be corrupt"
Steps 1. Created a manifest.json file (Code mentioned below)
{
“name”: “Webrequest API”,
“version”: “1.0”,
“description”: “Extension to handle Authentication window”,
“permissions”: [
“webRequest”,
“webRequestBlocking”,
“”
],
“background”: {
“scripts”: [“webrequest.js”]
},
“manifest_version”: 2
}
Created webrequest.js file. Code mentioned below.
var target = “https://sso.viacomcloud.com/”;
var myCredentials = { username: “getestone”, password: “V*******” } var pendingRequests = []; // A request has completed. // We can stop worrying about it. function completed(requestDetails) { console.log(“completed: ” + requestDetails.requestId); var index = pendingRequests.indexOf(requestDetails.requestId); if (index > -1) { pendingRequests.splice(index, 1); } } function provideCredentialsSync(requestDetails) { // If we have seen this request before, then // assume our credentials were bad, and give up. if (pendingRequests.indexOf(requestDetails.requestId) != -1) { console.log(“bad credentials for: ” + requestDetails.requestId); return {cancel:true}; } pendingRequests.push(requestDetails.requestId); console.log(“providing credentials for: ” + requestDetails.requestId); return {authCredentials: myCredentials}; } browser.webRequest.onAuthRequired.addListener( provideCredentialsSync, {urls: [target]}, [“blocking”] ); browser.webRequest.onCompleted.addListener( completed, {urls: [target]} );
Created a zip file using 7-zip file manager and renamed the zip file as Ext.xpi
Opened about:config on firefox (verson 70) and changed xpiextensionsignrequired to ‘False’
Opened about:addons on firefox. Selected ‘install extension from a file’. Select the Ext.xpi created in step 4 above.
I get the following error: ” this add on could not be installed because it appears to be corrupt.” instead of getting the Install option on Firefox browser.
Please help @SubjectiveReality