firefox-addon

How to upload an image to ImgBB API using Javascript in a firefox addon

扶醉桌前 提交于 2021-02-19 06:06:40
问题 Info on the API can be found here. It does not give any details for using with Javascript, only with curl. Have tried numerous different methods from old posts on here but this is the closest I have got so far. function main() { var ul = document.querySelector('.redactor_toolbar') if(ul != null) { var new_li = document.createElement('li') var new_a = document.createElement('a') new_li.appendChild(new_a) ul.appendChild(new_li) new_a.addEventListener('click', function() { var input = document

Porting Chrome extension to Firefox : equivalent to chrome.storage

强颜欢笑 提交于 2021-02-19 01:25:52
问题 I'm trying to port Chrome extension to Firefox and I would like to know what's the equivalent to chrome.storage.local.set and chrome.storage.local.get in Firefox add on sdk. I think, it's simple-storage . Here is my code : chrome.storage.local.set({'tokenFU': token}); [...] chrome.storage.local.get('tokenFU',function(result){ token=result.tokenFU; if(token && token != 'undefined'){ hideLog(); } else showLog(); }); Thanks in advance ! 回答1: Yes exactly, it is simple-storage. You can use it like

Porting Chrome extension to Firefox : equivalent to chrome.storage

被刻印的时光 ゝ 提交于 2021-02-19 01:25:47
问题 I'm trying to port Chrome extension to Firefox and I would like to know what's the equivalent to chrome.storage.local.set and chrome.storage.local.get in Firefox add on sdk. I think, it's simple-storage . Here is my code : chrome.storage.local.set({'tokenFU': token}); [...] chrome.storage.local.get('tokenFU',function(result){ token=result.tokenFU; if(token && token != 'undefined'){ hideLog(); } else showLog(); }); Thanks in advance ! 回答1: Yes exactly, it is simple-storage. You can use it like

How do I create native looking popups in a web extension for Firefox?

馋奶兔 提交于 2021-02-08 03:39:58
问题 I want a native looking popup (menu) in a Firefox web extension. Example: What I have now Irrelevant parts omitted manifest.json: "browser_action": { "browser_style": true, // injects chrome://browser/content/extension.css "default_popup": "popup.html" } popup.html: <div class="panel"> <div class="panel-list"> <div class="panel-list-item"> Item 1 </div> <div class="panel-list-item"> Item 2 </div> <div class="panel-list-item-separator"></div> <div class="panel-list-item"> Item 3 </div> </div>

How to send a message to a Firefox extension using a C# Application?

 ̄綄美尐妖づ 提交于 2021-02-07 09:39:20
问题 I have created a Firefox extension and a C# application and I need to send a String to my extension to perform some work I need to send it through an HTTP request like sockets. I have read about nsIServerSocket and having trouble connecting to my C# application Firefox (extension) code: function startServer() { var listener = { onSocketAccepted : function(socket, transport) { input = clientSocket.openInputStream(0, 0, 0); }, onStopListening : function(socket, status){} }; var serverSocket =

How to send a message to a Firefox extension using a C# Application?

做~自己de王妃 提交于 2021-02-07 09:38:49
问题 I have created a Firefox extension and a C# application and I need to send a String to my extension to perform some work I need to send it through an HTTP request like sockets. I have read about nsIServerSocket and having trouble connecting to my C# application Firefox (extension) code: function startServer() { var listener = { onSocketAccepted : function(socket, transport) { input = clientSocket.openInputStream(0, 0, 0); }, onStopListening : function(socket, status){} }; var serverSocket =

How to send a message to a Firefox extension using a C# Application?

北战南征 提交于 2021-02-07 09:38:46
问题 I have created a Firefox extension and a C# application and I need to send a String to my extension to perform some work I need to send it through an HTTP request like sockets. I have read about nsIServerSocket and having trouble connecting to my C# application Firefox (extension) code: function startServer() { var listener = { onSocketAccepted : function(socket, transport) { input = clientSocket.openInputStream(0, 0, 0); }, onStopListening : function(socket, status){} }; var serverSocket =

How to send a message to a Firefox extension using a C# Application?

耗尽温柔 提交于 2021-02-07 09:38:07
问题 I have created a Firefox extension and a C# application and I need to send a String to my extension to perform some work I need to send it through an HTTP request like sockets. I have read about nsIServerSocket and having trouble connecting to my C# application Firefox (extension) code: function startServer() { var listener = { onSocketAccepted : function(socket, transport) { input = clientSocket.openInputStream(0, 0, 0); }, onStopListening : function(socket, status){} }; var serverSocket =

Why is this code not working? I am creating a Firefox extension but the code is not running. But if I paste the code into the console it works

妖精的绣舞 提交于 2021-02-04 19:55:33
问题 I make a firefox extension that get all the request url's and displays them. But the code only works if I paste it in the console. when the extension loads it doesn't show any error, it seems like it just won't run here is the full code xhrScript.js (function(){ const proxiedOpen = XMLHttpRequest.prototype.open; window.XMLHttpRequest.prototype.open = function ( _, url) { this.__URL = url; return proxiedOpen.apply(this, arguments); }; const proxiedSend = window.XMLHttpRequest.prototype.send;

XMLHTTPRequest response doesnt contain Location field in the header

回眸只為那壹抹淺笑 提交于 2021-02-04 19:34:26
问题 I was trying to modify the adblockplus code for testing purpose. I was modifying the code to send a http get request on a URL and get the final URL from the response. I tried using the below code, but the response doesn't contain the Location field in the header response. I am doing this within a firefox-extension, so I dont think cross-domain request would be any issue. Why is it that I am not able to fetch the Location field from the response? Is there a better way to accomplish this task ?