I was uploading an image using the safari browser, it does not return any ipfs hash.
While on the other hand, it returns the ipfs hash if I am using a desktop web browser.
Can anyone help me with this, or at least explain the process?
EDIT: we noticed you’re using iOS simulator. Based on that, we released 1.0.4 version for #fleekhq/fleek-storage-js that adds a fallback for case sensitive headers https://github.com/FleekHQ/fleek-storage-js/pull/6. Can you try this version to see if it works for you?
Please note that this service is based on Minio and the current authentication is only setup for calls from a server (not a browser for example). This is because it uses API secrets and we don't want to expose them in the browser. Having said that, will take a look at why our Minio fork is not sending the header in those cases (it just hasn't been a priority to replicate because it is not advised to use from browser like that).
Related
I have an Android app built using Cordova. Version 1, which has been released for a while, stores some data using IndexedDB. I’m ready to release the next version but updating the app wipes all the data stored in IndexedDB.
What I noticed is that on Version 1, it uses cordova-android#^7.0.0 which uses file:// as the security origin (I knew this from the debug tool). Then, on the next version, I upgrade the cordova to cordova-android#^9.0.0. Now, it is using http://localhost as the security origin.
is there a way to migrate all the existing data when the app upgraded?
The only way would have been, in the previous version, to dump JSON data into a local file as a back up, then on the next upgrade, check if the local file is present and load/inject it back to IndexedDB. But it's probably too late now...
I don't see a solution as you are set up right now...
I just upgraded from cordova-android#^8.1.0 to cordova-android#^11.0.0 and had the same issue you described.
I didn't find any solution or question besides this thread.
Just before giving up, I looked at cordova source and logic, and saw that there is a parameter called "AndroidInsecureFileModeEnabled".
I set it to true on the config.xml and it worked!
The app came back to use "file://" as the security origin, so after upgrade the app still logged in.
Later I searched about this param and found some docs about it so it's important to know the insecure impact of setting it to true. For now I don't have any choice but to use it. I hope that it doesn't affect or can break anything else...
Let me know if it helps.
https://cordova.apache.org/docs/en/dev/config_ref/
https://cordova.apache.org/announcements/2021/07/20/cordova-android-10.0.0.html
I have website link at which I have designed a html/javascript web app. I used iOS and Android app to create an app that encapsulates the web app.
Is there a way to block access to the website link and only allow access to the website link only thru the native apps calling the link.
In short safari, IE, Chrome must not be able to access the link, but the iPhone & Android app should be able to access it.
Is there some way to tell that the app is accessing the site and not the phone or pc browsers.
I am sure there a number of ways to implement this.
Thanks,
It depends on how is the web app implemented. Since native Web Views are pretty much the wrapper for the standard browser (Safari/Chrome), you will find it tough to filter it based on that.
What you can do, however, is to add an extra GET variable (for ex. &ref=youruniquecodehere) or a custom User-Agent, based on which you will be able to identify, whether your application authorized the request (with a proper access code) or if it's a generic request using browser.
However, both of these options can still be bypassed if researched, although it'd require slightly more time. Not sure whether a solution that would work in 100% of cases exists.
Hope that helps, please correct me if I'm wrong.
Is it possible to open a link in another browser using Javascript?
I basically want to open Firefox from Google Chrome. I'm (attempting to) write an extension for chrome, but I can't find anything pointing to be able to do this.
I think I could use NPAPI plugins for Chrome, but they are being deprecated and are very insecure, so are there any alternate options?
You did not provide enough info so I can't asses the utility of what I'm about to offer, but here's an option:
Basically, use URL schemes to launch your application of choice from the browser. Start reading this SO question - How do I register a custom URL protocol in Windows?. You'll need to register some prefix - like "firefox://" for it to work. Should also be possible on other platforms.
Of course, this assumes that your user has firefox installed and that you can register on their machine. If this application is meant for a the general public, you'll need to perform those by some other means (installer?)
Yet another way to go is (as mentioned above) to run some native code via the extension. Not a simple choice: once again you need to somehow install the native code on the host machine (and you cannot do that via Chrome extensions, for security reasons).
You can use Native Messaging, paired with a native program which will launch the browser. I would write the native application in something like Python.
I am creating a Cross browser Platform Web Application (HTML, JS, CSS), However I require a strong database storage that I can query on the client using JS. Web SQL/SQLite seems to be the best way to go BUT there is no support for it in IE. Does anyone know of any other querable client storage out there. or a working implementation of embedding SQLite "like" functions into the browser.
Thanks
The Web Storage API is available in all major browsers including mobile and desktop. I haven't used it before, but from my research I can tell that it doesn't use SQL queries. It seems to be the best option, even so I would recommend still using a fallback for browser that won't support the API (for example anything before IE8).
Hope this works out for you!
I plan to have a completely separate layout/design for a desktop Vs tablet user. My app is based on Java.
My questions are;
1. What is the best approach to detect whether the request is coming from desktop or tablet (iPad/Xoom, etc)
2. Can this be handled at server-side and not through JS user-agent string?
A live example of redirect is if one tries to access Yahoo. i.e. if the request comes from a desktop browser, we’ll be redirected to www.yahoo.com , while if the request comes from a tablet device like iPad, we’ll be redirected to www.yahoo.com/tablet
I am planning something along the Yahoo example. Not sure how they have implemented it.
I know some of you might be thinking that I should just control 2 separate CSS like desktop.css and tablet.css and detect through CSS media query OR JS user-agent. But the point is the layout/design is so different between the 2 that I just cannot control only via CSS and that is the reason, I plan to have a separate tablet version of my web app and do the redirection.
Please let me know as much suggestions that you can.
Thanks in advance for your help on this.
You have to check for the user-agent string within your HTTP request. Based on that you will be able to identify the device -- provided that the user has not altered the user-agent string sent from the device browser.
I've had to deal with pretty much the same issue, having to differantiate between Desktop or Not-Desktop. I went with a client-side detection using JavaScript. I'm using RequireJS in my solution, and here's my module:
define(function(){
var isTouchDevice = function() { return window.screenX === 0 && 'ontouchstart' in window || 'onmsgesturechange' in window; };
var isDesktop = !isTouchDevice() ? true : false;
return isDesktop;
});
I've added the variable isDesktop for readability.