Dweb.page icon indicating copy to clipboard operation
Dweb.page copied to clipboard

Search doesn’t work in Firefox

Open da2x opened this issue 7 years ago • 10 comments

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

da2x avatar Jan 08 '19 04:01 da2x

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 avatar Jan 08 '19 09:01 Noc2

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 avatar Jan 13 '19 21:01 Noc2

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/

da2x avatar Jan 14 '19 11:01 da2x

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.

Noc2 avatar Jan 14 '19 15:01 Noc2

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.

da2x avatar Jan 14 '19 20:01 da2x

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 avatar Jan 14 '19 21:01 Noc2

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

Noc2 avatar Jan 15 '19 20:01 Noc2

  • 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.

da2x avatar Jan 17 '19 03:01 da2x

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)

pezinek avatar Jan 18 '19 09:01 pezinek

@pezinek I just opened a new issue for this problem: https://github.com/PACTCare/Dweb.page/issues/6

Noc2 avatar Jan 18 '19 10:01 Noc2