Ported Chrome extension to Firefox not working (indexedDB error) - firefox

I'm trying to port the Twitter Notifier extension to FF.
I'm not too familiar with JavaScript so I just used extension factory to convert it to FF.
Unfortunately it is not working; I don't get any HTML5 desktop notifications.
I've looked at the code a bit and I think the problem is with twitter.js which should be found in the path 'resources\extension-data\js'.
http://pastebin.com/C0NqU4Ur
First I've changed
twitter.messagesDB = window.webkitIndexedDB.open("messagesDB");
to
twitter.messagesDB = window.mozIndexedDB.open("messagesDB");
but it still is not working.
The error console also doesn't show any error.
When I put a console.log command to the twitter.messagesDB.onsuccess function nothing is being outputted to the error console.
Also no output when I create an onerror function.
So I though to surround the functions with a try and catch clause but no error is being thrown.
So I tried to put twitter.messagesDB = twitter.messagesDB.result; out of the function and the following error shows up in the error console:
Error: uncaught exception: [Exception... "A mutation operation was attempted on a database that did not allow mutations." code: "6" nsresult: "0x80660006 (NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR)" location: "chrome-extension://gjlehiopfilnaggndcmbhphaglkbkekf/js/twitter.js Line: 28"]
What does that mean?
How can I make it work in Firefox?
Thanks in advance!
Edit: I'm using Firefox 12 on Windows

This is due to an incompatibility between the Firefox implementation of IndexedDB, which supports the latest IndedexDB protocol published December 2011, and the Chrome implementation, which supports the version previous to that.
The breaking change is how databases are created, where the older (Chrome) implementation uses the setVersion transaction whereas the newer version (FF) uses an onupgradeneeded event and callback.
To see this change, please star this issue.

Related

Quickblox.sdk GetBaseSession() method throws "nonce is required" error

I have used quickblox chat sdk in my old xamarin.forms project. I know that quickblox is not supporting xamarin now, but old sdk was working fine till now, but from last week I am getting this error.
Code:
var baseSesionResult = await Provider.QbProvider.GetBaseSession();
When I am calling QbProvider.GetBaseSession() it throws below error:
CONTENT: {"errors":{"base":["nonce is required"]}}
I have tried different methods available in sdk but none is working. Any one know how to fix this error?
This is Nikolay from QuickBlox support.
Please add "" symbols around nonce and timestamp values and check if the issue is resolved.
The same information is mentioned in our documentation: https://docs.quickblox.com/reference/authentication#create-session
We released a patch for authentication that improves validation according to our documentation.
Hence, the issue is caused by incorrect implementation in the application that is why the server has started showing errors for submitted requests.

Outlook for mac - Office.context.mailbox.item.body.prependAsync() does work on current UI

I've been trying to understand why body.prependAsync() does not work only on Outlook for Mac (current UI with Microsoft365 Subscription). For all other browsers and Outlook for Mac (new UI with Microsoft365 Subscription), it is working perfectly; meaning the body of the email is being populated correctly. The API version being used is 1.7 and I can see that it's supported in this documentation.
The error that I'm receiving in the callback from body.prependAsync() is:
[2006] Invalid Format Error : The format of the specified data object is not valid.
In the error code documention, I see that this error could be caused by the following: The solution developer supplies an invalid HTML or OOXML string, a malformed HTML string, or an invalid OOXML string.
However, the body message needing to be displayed is a properly formatted HTML. I've even tried a regular string but still getting the same error.
The way I am calling it:
Office.context.mailbox.item.body.prependAsync(
'test',
{coercionType: Office.CoercionType.Html},
callback
)
Any advice is greatly appreciated. Thanks!

AWS Lambda: Calling the invoke API action failed with this message: [object Object]

This question has a few more details, in addition to the report here: AWS Lambda: Calling the Invoke API failed with message: [object Object]
When I try to invoke my Lambda function, by clicking on "Test" button, I see the error reported.
Issue seen on browser: Firefox Nightly 64.0a1 (2018-10-15) (64-bit), on a Windows 10 system.In the browser console, I see this error:
TypeError: asm.js type error: Disabled by 'asmjs' runtime option rusha.min.js
In the Network tab, of the Firefox dev-tools, I see that the invocation returns with a 403 error. The response is :
{"message":"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details."}
Everything works as expected on Microsoft Edge, and Chrome browsers.
Asm might be a red herring, but I can believe AWS might well be using it to speed up their signing. This fits, as the error you're seeing occurs when you try to do something on the AWS Api without the v4 signature being correct.
I notice you're using a nightly build of firefox, so you might well be subject to a known bug &c, or asm.js might be disabled for that platform.
Following the error, I suggest you try going to about:config (to change your firefox configuration), and set javascript.options.asmjs to true.
Failing that, you might have to get off the nightly build or raise a bug report.
This was an issue / bug, that has since been fixed in Firefox Nightly (and should flow into Firefox standard release).
The details of the issue are here: https://bugzilla.mozilla.org/show_bug.cgi?id=1499136
In Firefox's about:config, the key
dom.xhr.standard_content_type_normalization is now set to false by default.

The example about native message in Firefox

I'm trying to use the native message in Firefox, and I'm trying to run the example in https://www.github.com/mdn/webextensions-examples/native-messaging/, but Firefox gave me a notice says:
"attempt to post Message on disconnected port."
I tried everything that I can, but it doesn't work. Could anybody help me?

Chromecast sample sender application CastHelloText-chrome ends with error when trying to get session

I have problem with launching Google-Cast application similar to sample CastHelloText-chrome. I slightly modified example code for my specific purposes. The goal for creating this application is to send and show image data directly in Chromecast device.
Particularly the difference between official sample and my code is in message format and its content, sent by sender application. Sender application took png image coded by base64 and send through message bus with custom namespace. Receiver application get this message and use this as data source for html object <img>.
Error appears when I do this steps:
Reload sender page, checking console if any device found.
Send the form by just pushing enter on input box (text is ignored).
Now a popup from Chromecast extension shows. Next there are two scenarios:
3a) I confirm casting to device by choosing one from the list, then I get this error message in console:
onError: {"code":"channel_error","description":"Error: Timeout","details":null}
3b) I just click somewhere else, I get this error:
onError: {"code":"cancel","description":"User closed popup menu","details":null}
Both of errors are caused by calling function chrome.cast.requestSession in chromehellotext.html at line 161, but what's really wrong I don't know.
When I step sender script I realize that function sessionListener is never called. I know that something go wrong when code try to call chrome.cast.requestSession, where described error raises. So I need help if I missed about right way to use Google-Cast API or If this problem has something to do with networking issues.
Receiver application is registered on Google Cast SDK Developer Console and I'm testing on registered device with some serial number. I'm using Google Chrome in version 42.0.2300.2 canary (64-bit) and Chrome version 40.0.2214.111 (current stable I suppose). For testing I also tried to turn off Windows Firewall entirely but with no luck.
Edit:
There were some syntactic errors that caused error message described above.
It seems like you are trying to use the data/control channel to send an image; please don't do that; that channel is not meant to be used for large data communications; in fact it cannot send anything which approaches or exceeds 64k. If your goal is to send images from your local machine, you would need to run a local web server on your local machine and serve images through the web server.
For and easiest tutorial you can have a look to this tutorial.
It is well explained in this tutorial.
Chromecast Sender application
There is no need to maintain session by yourself.
just add button and enjoy casting
mCastManager.addMediaRouterButton(mediaRoutebtn);
I found a source of my problem. There was something wrong in receiver code - syntactic and runtime errors, so I must admit that my code wasn't functional. Now its working in terms of launching application and getting session.
Unfortunate thing is that the error message generated by Chromecast extension didn't match the actual error - at least it was a bit confusing when I didn't know what's really happening on receiver side without ability to debug the code.

Resources