App displays URL images from other URLs than my own - image

I am unable to make the URL public, but I've pasted the full URL into my browser and can confirm the page is right - the image shows in the browser.
But... when I copy that exact URL into a Xamarin.Forms image, set as:
<Image
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"
Aspect="AspectFit">
<Image.Source>
<UriImageSource Uri="https://example.com/images/doesntshow.jpg"
CacheValidity="3"
CachingEnabled="false"/>
</Image.Source>
</Image>
The image simply will not show.
If I substitute the URL: "https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg" the image shows fine.
NOTE: There is 0 possibility the URL is incorrect or has an error because... I'm not typing it; I'm copying/pasting it and it's showing just fine in the browser, just not the Xamarin.Forms app.
I've not a clue as to what to look for. Does anyone else?

ISSUE RESOLVED - thanks for the good mental vibes :)
I found the resolution here:
https://forums.xamarin.com/discussion/105036/images-from-url-not-showing-on-android
April 5
"Just change the following options and it should work with https too.
Android Options => Advanced
HttpClient implementation = Set to "Managed" option value
SSL/TLS implementation = set to "Native TLS 1.2+" option value"
I still don't understand why prior to this setting change, I could load https images from other servers just fine (e.g. "https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg"). So... I will lose a bit of sleep wondering what is different on my server from wiki's. If you have a clue, please share.

Related

Is it possible to force fail a recaptcha v2 for testing purposes? (I.e. pretend to be a robot)

I'm implementing an invisible reCAPTCHA as per the instructions in the documentation: reCAPTCHA V2 documentation
I've managed to implement it without any problems. But, what I'd like to know is whether I can simulate being a robot for testing purposes?
Is there a way to force the reCAPTCHA to respond as if it thought I was a robot?
Thanks in advance for any assistance.
In the Dev Tools, open Settings, then Devices, add a custom device with any name and user agent equal to Googlebot/2.1.
Finally, in Device Mode, at the left of the top bar, choose the device (the default is Responsive).
You can test the captcha in https://www.google.com/recaptcha/api2/demo?invisible=true
(This is a demo of the Invisible Recaptcha. You can remove the url invisible parameter to test with the captcha button)
You can use a Chrome Plugin like Modify Headers and Add a user-agent like Googlebot/2.1 (+http://www.google.com/bot.html).
For Firefox, if you don't want to install any add-ons, you can easily manually change the user agent :
Enter about:config into the URL box and hit return;
Search for “useragent” (one word), just to check what is already there;
Create a new string (right-click somewhere in the window) titled (i.e. new
preference) “general.useragent.override”, and with string value
"Googlebot/2.1" (or any other you want to test with).
I tried this with Recaptcha v3, and it indeed returns a score of 0.1
And don't forget to remove this line from about:config when done testing !
I found this method here (it is an Apple OS article, but the Firefox method also works for Windows) : http://osxdaily.com/2013/01/16/change-user-agent-chrome-safari-firefox/
I find that if you click on the reCaptcha logo rather than the text box, it tends to fail.
This is because bots detect clickable hitboxes, and since the checkbox is an image, as well as the "I'm not a robot" text, and bots can't process images as text properly, but they CAN process clickable hitboxes, which the reCaptcha tells them to click, it just doesn't tell them where.
Click as far away from the checkbox as possible while keeping your mouse cursor in the reCaptcha. You will then most likely fail it. ( it will just bring up the thing where you have to identify the pictures).
The pictures are on there because like I said, bots can't process images and recognize things like cars.
yes it is possible to force fail a recaptcha v2 for testing purposes.
there are two ways to do that
First way :
you need to have firefox browser for that just make a simple form request
and then wait for response and after getting response click on refresh button firefox will prompt a box saying that " To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier. " then click on "resend"
by doing this browser will send previous " g-recaptcha-response " key and this will fail your recaptcha.
Second way
you can make any simple post request by any application like in linux you can use curl to make post request.
just make sure that you specify all your form filed and also header for request and most important thing POST one field name as " g-recaptcha-response " and give any random value to this field
Just completing the answer of Rafael, follow how to use the plugin
None of proposed answers worked for me. I just wrote a simple Node.js script which opens a browser window with a page. ReCaptcha detects automated browser and shows the challenge. The script is below:
const puppeteer = require('puppeteer');
let testReCaptcha = async () => {
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
await page.goto('http://yourpage.com');
};
testReCaptcha();
Don't forget to install puppeteer by running npm i puppeteer and change yourpage.com to your page address

React Native Image Not Working with specific URL

I have the following code below, where the Image component encompasses two Image component.
<View style={styles.container} >
<Image
style={{width: 50, height: 50}}
source={{uri: 'https://facebook.github.io/react/img/logo_og.png'}}
/>
<Image
style={{width: 50, height: 50}}
source={{uri: 'http://lghttp.24811.nexcesscdn.net/80B00B/qpb/media/catalog/product/cache/11/image/439x334/9df78eab33525d08d6e5fb8d27136e95/q/w/qw_neverdonejoggers_p_.png'}}
/>
</View>
For the first github URL it renders the img logo correctly as expected.
However for the second Image it doesn't render the source: qw_neverdonejoggers_p_.png
Which leads me to the conclusion that something wrong URL, however clicking on the URL correctly load the Img:
http://lghttp.24811.nexcesscdn.net/80B00B/qpb/media/catalog/product/cache/11/image/439x334/9df78eab33525d08d6e5fb8d27136e95/q/w/qw_neverdonejoggers_p_.png
I attempted to replicate the issue here, https://rnplay.org/apps/_dQXXw
but it renders both the images properly.
So its only on the local my computer that for some reason I can render second image ?
Using:
"react": "15.4.1",
"react-native": "^0.39.2",
Andrés' answer is somewhat correct, but it does not address the exact cause of the problem, and that is iOS' App Transport Security. iOS does not allow plaintext requests (http) by default, and so you need to define a 'whitelist' of URLs that can be allowed to override this particular protection mechanism. You have that list already set up so that your app can connect to localhost during development,, so just add new entries to it. You can see how to do so in this answer. Of course, this only works if you know the list of URLs in advance, which might not suit your needs. In that case, have a look at this article.
uri only works with https. In Android it should work fine with either http or https.
You will find further information here.
Guys there is an issue with Image component is that if first time initialize the component with source={{uri : 'some link'}} it may not work (at least not for me when I fetch image from HTTPS URL from Firebase storage). The trick is you have to trigger a change to source props like first you need to keep
source to source={undefined} and then change to source={{uri : 'some link'}}.
Hope it would help someone
Aside issue with HTTPS, make sure you set the width and height of the Image
How i make Image source with http or https url work is by resetting the android emulator am using.
You can clear the emulator by opening the android studio then click on tools tab at the top bar select AVD Manager once it open
Select the emulator you are using, right click on it then select wipe data.
Once that process is completed, open cmd or terminal at the root of your react-native project
$ npx react-native run-android

Firefox - Set capability not working

I want to block image and Javascript from third-part on load, and edit user.js in profile folder to merge with pref.js when Firefox startup.
Here's my code in user.js:
user_pref("capability.policy.policynames", "noimage, nojs, nohrefs");
user_pref("capability.policy.nojs.sites", "http://abc.xyz https://abc.xyz");
user_pref("capability.policy.nojs.javascript.enabled", "noAccess");
user_pref("capability.policy.noimage.sites", "http://abc.xyz https://abc.xyz");
user_pref("capability.policy.noimage.permissions.image", 3);
user_pref("capability.policy.nohrefs.sites", "http://abc.xyz https://abc.xyz");
user_pref("capability.policy.nohrefs.HTMLAnchorElement.href", "noAccess");
I check it in "about:config" and see it show but it's didn't work in fact at anytime.
How to make it work ?
Reference links:
http://kb.mozillazine.org/index.php?title=Category:Preferences&until=Places.frecency.unvisitedTypedBonus
http://www-archive.mozilla.org/projects/security/components/ConfigPolicy.html
In case someone is still looking for an answer, the capability.policy.nojsbroken.javascript.enabled is gone since Firefox 29, please refeer to this answer.

Data binding the Image control in Windows 8 to a URL?

In Windows 8/Store programming, how would you go about databinding an image to a URL. In other platforms I've worked with, I would set the source property (or equivalent) to the URL and the platform would handle it for me, but that doesn't seem to be the case here.
I'm currently binding it to a property for my business object that is of type "string", and returns the URL of the image that I want populated in the image control. How would I go about doing this?
Turns out this is really easy.
Code:
<Image Stretch="UniformToFill">
<Image.Source>
<BitmapImage UriSource="{Binding Path=ImageUrl}" />
</Image.Source>
</Image>
ImageUrl is a Uri containing the path to the remote image.

Problem with WebKit rendering google.com (and a few other sites)

I'm a noob to Cocoa programming, so please excuse the possible stupidity of this question.
I'm trying to build a web browser using Cocoa/MacRuby but am running into this strange rendering problem - a lot of sites render just fine, but all Google sites and a bunch of other sites (such as the CouchDB website) render with very small fonts.
I tried to mimic Firefox's HTTP request and set headers like so:
def initialize_request(url)
url_request = NSMutableURLRequest.requestWithURL(NSURL.URLWithString(url))
url_request.setValue("ISO-8859-1,utf-8;q=0.7,*;q=0.7", forHTTPHeaderField:"Accept-Charset")
url_request.setValue("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", forHTTPHeaderField:"Accept")
url_request.setValue("en-us,en;q=0.5", forHTTPHeaderField:"Accept-Language")
url_request.setValue("gzip,deflate", forHTTPHeaderField:"Accept-Encoding")
url_request.setValue("keep-alive", forHTTPHeaderField:"Connection")
url_request.setValue("300", forHTTPHeaderField:"Keep-Alive")
headers = url_request.allHTTPHeaderFields
NSLog("All headers: #{headers.inspect}")
url_request
end
Full source file is here
Any pointers will be helpful, thanks in advance!
Check the font size in your app's WebPreferences and the text-size multiplier on the WebView.

Resources