IE download html file instead of opening on Glassfish - glassfish

I deploy my site on glassfish server.
My site run ok on Chrome, Firefox, opera.. but it not work on IE browser.
My IE Browse auto save the html file instead opening it.
Please help! Thanks so much!

Related

Can not access to Zenmate extension webpage only in incognito mode

I try to access Zenmate extension webpage using Selenium and i succeeded opening it in regular mode but i cant access to webpage in incognito mode. I get the error "This page has been blocked by Chrome ERR_BLOCKED_BY_CLIENT". It works perfectly fine in regular window. How can i solve this issue? I need to use it in incognito because dealing with cache and saved data is not good for my Selenium code to run.This is my code to get the webpage.
driver.get('chrome-extension://fdcgdnkidjaadafnichfpabhfomcebme/index.html')

PDF loads on computer but downloads on mobile

I have my resume hosted on resume.momohossa.in
My issue is that when I try to reach this site on my computer, it just opens in a new page. However, when I try to open it on my phone, it has to download the file. Then, I have to open the downloaded file on a PDF viewer such as adobe. I would like for it to not immediately download on my phone. Does anyone have any advice?
Thank you in advance!
By default, on iOS devices, its safari browser can view PDF file directly, and for android deveices, its chrome browser also can do that.
make sure you pdf file is not a stream output file. just make it a static file, e.g. http://host/target.pdf not http://host/pdf/target

IE 10 not using AppCache after browser closed

I wrote an application using the HTML5 Cache Manifest and I'm having a problem using it in IE 10.
I used Fiddler to witness the manifest file being downloaded and all resources fetched on the initial load of the application. If I disable my network adapter to force the machine offline, the application continues to work as expected as long as I don't close the browser window.
However, when I close the browser window, then attempt to re-open the page from a favorite, IE 10 tells me "You're not connected to a network". Obviously I know that, I'm trying to use the app offline. These exact steps work in Chrome.
Is this behavior by design? Is there a workaround? I can't test with IE 11 right now...is this different in IE 11?
Hearing of some issues of the appcache clearing if your company utilizes gpo settings and has "empty temporary internet files folder when browser is closed" enabled.
Did you find the answer to this? I have the same problem. I did get a bit further though. I found that if you go to the IE10 File menu option and tick Work Offline then try and access your cached app it loads the page but I still have an issue as it does not appear to be using the javascript file that should also be cached. All works ok on Google Chrome but our clients are restricted to IE so Chrome is not an option.

WebRTC - Browser doesn't ask for mic access permission for local html file

I have some simple webRTC code which uses getUserMedia to gain access to user's mic. Now when I load that html file (saved at my localhost) in my browser, the browser doesn't ask for mic access permission and thus get failed to get access.
But when I run the same html inside the w3schools.com editor, it asks for mic access permission and upon allowing it to access my mic, it works fine...
Why is this strange behaviour?
When you open an html file right off the filesystem (file:// prefix), Chrome will auto-block getUserMedia permissions. You have to run a server locally.
I started up a sinatra server like this:
# server.rb
require 'sinatra'
get '/' do
File.read('index.html')
end
Then give it ago.
$ gem install sinatra
$ ruby server.rb
http://localhost:4567
Because of security Chrome won't open user media, e.g. WebCam when executing a file:/* document.
You could override however the security policy by starting chrome with the --disable-web-security command line option.
For testing check also the --use-fake-device-for-media-stream option.
N.B. When specifying command line options make sure there is no chrome/chromium process running.
P.S Give it a try by creating a file test.html containing
<!DOCTYPE HTML>
<video autoplay/>
<script>
navigator.webkitGetUserMedia({audio:true,video:true},
function(stream){
document.querySelector('video').src =
URL.createObjectURL(stream);
});
</script>
and than kill all chrome instances and start chrome like this:
chrome.exe --use-fake-device-for-media-stream --disable-web-security test.html
This behavior is caused by Chrome security settings.
If you have PHP installed and you don't wanna setup Apache or other more advanced web server, probably the easiest way would be to run internal PHP web server this way (assuming you have your web files in /home/user/web/):
php -S 127.0.0.1:3000 -t /home/user/web/
Here is a description of the parameters:
-S <addr>:<port> Run with built-in web server.
-t <docroot> Specify document root <docroot> for built-in web server.
After you run the server start your browser and open this URL (assuming your test file is called webrtc.html):
http://127.0.0.1:3000/webrtc.html
Just some troubleshooting suggestions:
Check chrome://settings/content (scroll down to "Media"), to see if you've accidentally selected that site to always allow or always deny. (I'm on Chrome 26[dev]; this may be located somewhere else on Chrome 24.)
Also try restarting your browser - this bit of Chrome is still pretty buggy in my experience, and sometimes a restart fixes it.
And make sure you've got an error handler in your getUserMedia() call - there may be some additional info there.
Are you loading the file via something like file://? It seems chromium does not give access to those files at all and completely ignores the request. Just tried myself and after uploading the file to a dev server it worked fine.
Even setting it to allow always it still does not work with file://.
You can't run HTML5 that uses getUsermedia API locally without using a local server. Use WampServer and place your HTML5 file inside the www folder.
This answer is for chrome
In Chrome you can use the --allow-file-access-from-files flag to allow webcam access from a local file.
Mac
On a mac you can open the terminal and type:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --allow-file-access-from-files /path/to/file.html
change /path/to/file.html with your path
Windows
In Windows you can create a shortcut. Right click Google Chrome And in the menu select: Copy To -> Desktop (shortcut), then right click the shortcut and click properties add the flag:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --allow-file-access-from-files C:\path\to\file.html
Hope this answer helps!

How to open a website with google chrome

I am making a desktop search app. I need a way to set the web browser target to Google Chrome. I.e., if a person clicks a button in my app it will open Chrome with the website instead of Internet Explorer.
run the chrome exe with a url as the first arg
chrome.exe xkcd.com
So something like...
Process.Start("pathToChrome\\chrome.exe", "xkcd.com")