corollari / ankiTab

Browser extension that replaces the new tab page with Anki flashcards
https://ankitab.com
The Unlicense
187 stars 16 forks source link

Firefox unknow address #12

Closed Novite5 closed 5 years ago

Novite5 commented 5 years ago

After scoring the answer, Ankitab will jump to address:

chrome-search://local-ntp/local-ntp.html

which cannot be recognized by Firefox.

Thank you for your work!

corollari commented 5 years ago

Given that you mention that this happens after scoring an answer, it seems you could be using the feature requested in #7. Are you loading the extension unpacked from the answer-redirect branch?

Novite5 commented 5 years ago

No. I get the addon from Mozilla official store.

Novite5 commented 5 years ago

19:00:46.294 Error: Could not establish connection. Receiving end does not exist. Browser.js:3:1937 19:00:47.473 Error: Could not establish connection. Receiving end does not exist. Browser.js:3:1937 19:01:10.779 'NoneType' object has no attribute 'hide' ankiConnect.js:22:17 ankiConnectInvoke/</< moz-extension://e22a492a-4b7b-4a3a-b37d-9e3e9cf39d8a/libs/ankiConnect.js:22:17 19:01:11.471 TypeError: docShell.failedChannel is null[Learn More] NetErrorChild.jsm:683:13 19:01:11.693 Error: Could not establish connection. Receiving end does not exist. Browser.js:3:1937 19:02:06.404 NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIInterfaceRequestor.getInterface] network-response-listener.js:73

this is the error log in web console.

corollari commented 5 years ago

I see, then the redirection seems to be caused by the following code:

ankiConnectInvoke("guiDeckReview", {name: lastDeck})
                        .then(()=>chrome.storage.local.set({lastDeck: lastDeck}, resolve))
                        .catch((e)=>{
                            window.location.href="chrome-search://local-ntp/local-ntp.html"
                        });

I've been able to reproduce the bug, I'll start working on a fix.

corollari commented 5 years ago

Just fixed it! :tada: Thanks for reporting it :)

corollari commented 5 years ago

Just published the updated extension, it should be available after the review passes (~a few hours).

Novite5 commented 5 years ago

Great! It works. Thank you very much!