Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search doesn’t work in Firefox #5

Open
da2x opened this issue Jan 8, 2019 · 10 comments
Open

Search doesn’t work in Firefox #5

da2x opened this issue Jan 8, 2019 · 10 comments

Comments

@da2x
Copy link

da2x commented Jan 8, 2019

Console error:

OpenFailedError: UnknownError The operation failed for reasons unrelated to the database itself and not covered by any other error code.
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://[::1]/ipfs/na. (Reason: CORS request did not succeed).

UI error:

You have entered an invalid filename!

Version: /ipfs/QmafJoUPkhmKJSKJHFvpkZ5Hb5eUbQN8UBhuwrLVsH6W2K

User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

IPFS: ipfs-go 0.4.18, ipfs-companion 2.6.3

@Noc2
Copy link
Contributor

Noc2 commented Jan 8, 2019

Thanks for reporting and testing! Since you are using Dweb.page on your own ipfs gateway, the reason is probably that the files need a long time to load/propagate. I integrated a system to create so-called availability metadata and additional distribution of the files, but both needs a lot of improvement/refinement. It also has issues on the participating ipfs nodes at the moment. I will release an improved version as soon as possible.

@Noc2
Copy link
Contributor

Noc2 commented Jan 13, 2019

The latest version now has a new availability system which mixes location- and name-based addressing for faster content loading. I hope this solves your issue. See https://noreallyitis.me/ipfs/QmVpg1PnMyDPLspthDwN4rWZXw8AGRBvfe7e6Y82ZYHNHe/
If it doesn’t work feel free to reopen this issue.

@Noc2 Noc2 closed this as completed Jan 13, 2019
@da2x
Copy link
Author

da2x commented Jan 14, 2019

I can’t reopen the issue, but I can still comment.

I tried the new version and the error message is gone.

However, as soon as I press Open I get this in the console:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://[::1]/ipfs/QmQrXZ4iXdEKQMiQT6GRg2Wy3vxb9exR25sYdaqoHwWWuR. (Reason: CORS request did not succeed)

The problem here is that my local gateway’s port number is lost. The page is loaded from a local IPFS gateway at:

http://[::1]:4737/ipfs/QmVpg1PnMyDPLspthDwN4rWZXw8AGRBvfe7e6Y82ZYHNHe/

@Noc2
Copy link
Contributor

Noc2 commented Jan 14, 2019

Got it. Sorry, I only tested it on the cloudflare-ipfs.com address. The previous system didn’t work with different local ports. I fixed it with the latest version: https://ipfs.sopinka.com/ipfs/Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7/. Just let me know if it still doesn't work.

@da2x
Copy link
Author

da2x commented Jan 14, 2019

Seems to be working now!

My console is full of errors still, though. I’m asked to Agree to terms every time I open the page (even from the same address), and the Files tab gives me a new public key and says I’m in a private window in Firefox although I’m using a regular window.

Console errors:

Object { _e: Error, name: "OpenFailedError", message: "UnknownError The operation failed for reasons unrelated to the database itself and not covered by any other error code.", inner: {…}, stack: "" } Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7:38:204236
Object { _e: Error, name: "OpenFailedError", message: "UnknownError The operation failed for reasons unrelated to the database itself and not covered by any other error code.", inner: {…}, stack: "" } Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7:38:182532
Unhandled promise rejection TypeError: "a is undefined"
	t http://[::1]:4737/ipfs/Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7/:38:181378
	A http://[::1]:4737/ipfs/Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7/:21:348144
	_invoke http://[::1]:4737/ipfs/Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7/:21:347934
	e http://[::1]:4737/ipfs/Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7/:21:348320
	E http://[::1]:4737/ipfs/Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7/:38:177921
	a http://[::1]:4737/ipfs/Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7/:38:178123
	a http://[::1]:4737/ipfs/Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7/:21:175439
	P http://[::1]:4737/ipfs/Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7/:21:175584
	c http://[::1]:4737/ipfs/Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7/:21:333958
 Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7:21:175819

I can’t upload anything either. I get an “The current IPFS gateway you are using isn't writable!” error message but I’m never prompted to give it write permissions. I’ve confirmed that I have the IPFS Companion extension available and that the window.ipfs interface is exposed, and that it prompts for permissions just fine for other IPFS upload web interfaces.

Lastly, can I search-for/upload/add-to-index an existing hash that I’ve got on a local node? Reuploading the same file won’t create the same hash as I’m using the Rabin fingerprint chunker instead of the less efficient fixed-size 256 kiB chunker.

@Noc2
Copy link
Contributor

Noc2 commented Jan 14, 2019

Thanks for all the feedback and testing. I will reopen the issue since your describing multiple problems here, which aren’t fixed/integrated yet:

  • Firefox doesn’t allow the storage of nonextractable private keys inside indexeddb (https://bugzilla.mozilla.org/show_bug.cgi?id=1048931) even though it’s part of the official API. That’s why your key always changes for security reasons. At the moment this is only fully supported in Opera/Chrome.
  • Your firefox settings seem to block cookies (Agree to terms every time) and indexeddb (file history). At least the messages should be clearer about it.
  • I haven’t integrated support for the IPFS companion and window.ipfs yet.
  • Support for indexing previous uploaded content.

I will see what I can do.

@Noc2 Noc2 reopened this Jan 14, 2019
@Noc2
Copy link
Contributor

Noc2 commented Jan 15, 2019

Here is the first version with basic support for the ipfs companion/window.ipfs: https://pactcare.online/ipfs/QmeHJR27YxNp7VdwwH91fv1qgHHtL77dJuRV4Li1ZfN5k4

@da2x
Copy link
Author

da2x commented Jan 17, 2019

  • window.ipfs permission works.
  • Firefox is not set to reject first-party cookies or other storage
  • “Support for indexing previous uploaded content.” I think you can get metadata (and the actual data) about my local content from an IPFS CID through window.ipfs so you don’t even need to download a copy of it to index it.

@pezinek
Copy link

pezinek commented Jan 18, 2019

Actually the new version is broken in a different way, If I try to enter something to the search box, doesn't show any results but downloads file called "undefined.undefined" with content "invalid ipfs path: selected encoding not supported"
(browser chrome, using private ipfs gateway running go-ipfs v0.4.18, ipfs companion v 2.6.3)

@Noc2
Copy link
Contributor

Noc2 commented Jan 18, 2019

@pezinek I just opened a new issue for this problem: #6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants