browser

Differentiate browser refresh and browser close

做~自己de王妃 提交于 2021-02-08 09:08:40
问题 I want to set a cookie when a visitor on the page closes the browser. I used onbeforeunload method like this <script language="JavaScript" type="text/javascript"> window.onbeforeunload = confirmExit; function confirmExit() { return "You have attempted to leave this page. If you have made any changes to the fields without clicking the Save button, your changes will be lost. Are you sure you want to exit this page?"; } </script> followed this link But found out that even refresh of page or

Differentiate browser refresh and browser close

南楼画角 提交于 2021-02-08 09:06:30
问题 I want to set a cookie when a visitor on the page closes the browser. I used onbeforeunload method like this <script language="JavaScript" type="text/javascript"> window.onbeforeunload = confirmExit; function confirmExit() { return "You have attempted to leave this page. If you have made any changes to the fields without clicking the Save button, your changes will be lost. Are you sure you want to exit this page?"; } </script> followed this link But found out that even refresh of page or

CSS animation not working for mobile devices

让人想犯罪 __ 提交于 2021-02-08 07:27:32
问题 I am currently working on sidebar navigation for a mobile site and I am trying to include the below animation for the main menu button. This works well on different browsers except for mobile devices running iOS - Safari and Android - Android Browser. What am I missing? Thanks. http://jsfiddle.net/wvck5xnL/ HTML <div class="mainBtn"> <input id="mainmenuBtn" name="exit" type="checkbox" /> <label for="mainmenuBtn"><span class="burger"></span></label> </div> CSS body { padding:0; margin:0;

Is this behavior with the referrer when sending a XMLHttpRequest in Brave intended?

廉价感情. 提交于 2021-02-08 03:36:28
问题 var xhr = new XMLHttpRequest(); xhr.open('GET', 'https://httpbin.org', true); xhr.send(); When running this simple code above from example.org , request headers in Chrome devtools shows this: Host:httpbin.org Origin:http://example.org Referer:http://example.org When running the same code in Brave, I get this: Host:httpbin.org Origin:https://example.org Referer:https://httpbin.org I feel that that the referrer being the same that that the host is a bug, but maybe I'm missing something. Should

How to set media query for safari web browser

断了今生、忘了曾经 提交于 2021-02-07 20:24:16
问题 @media only screen and (min-width: 480px) and (max-width: 767px) { } Here is my media query how to fix it. how to set for safari web browser. 回答1: Media queries aren't made for browser detection. Use javascript instead, for example: if (navigator.userAgent.search("Safari") >= 0 && navigator.userAgent.search("Chrome") < 0) { alert("Browser is Safari"); } From this point you could set a class on the body tag to indicate a safari browser. if (navigator.userAgent.search("Safari") >= 0 &&

How to detect if browser is closed using jQuery

天涯浪子 提交于 2021-02-07 19:11:08
问题 I need to detect if the browser is being closed using jQuery, and do an event if this is true. I have a chat feature on my website (much like Facebook) that keeps the user logged in as they navigate to other pages within the website structure but needs to log them out of chat (so they do not appear online to others) if they click the browsers close button. So .unload() will not work because .unload() will apply the logout function to all window actions including navigating to another page

Default css for custom html tags?

别来无恙 提交于 2021-02-07 17:32:38
问题 I sometimes use custom html tags as containers for other elements: <message-panel></message-panel> Does an unknown element like the above have a default set of styles, common among the major browsers? And, is it possible to set a default style for all unknown elements on a page? 回答1: All unknown elements have a computed display value of “inline” source You can use * { ... } for all elements, however this means that you overwrite anything non-specific set for default elements too. It's better

Default css for custom html tags?

给你一囗甜甜゛ 提交于 2021-02-07 17:30:05
问题 I sometimes use custom html tags as containers for other elements: <message-panel></message-panel> Does an unknown element like the above have a default set of styles, common among the major browsers? And, is it possible to set a default style for all unknown elements on a page? 回答1: All unknown elements have a computed display value of “inline” source You can use * { ... } for all elements, however this means that you overwrite anything non-specific set for default elements too. It's better

Opening TWebBrowser link in default browser

给你一囗甜甜゛ 提交于 2021-02-07 14:33:22
问题 My application displays a small banner loaded from the web in a TWebBrowser control. This banner is actually a HTML page including an image; when the users click the image it takes them to the promotional campaign we're currently running. The bad thing here is that when clicking the link in TWebBrowser, the campaign page is opened in Internet Explorer, not in their default browser. I know this happens because TWebBrowser is a IE-based control, but is there a way to open the link in users'

Browser for CSS shaders? [closed]

陌路散爱 提交于 2021-02-07 14:23:21
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . Improve this question Is there a browser which supports CSS shaders? 回答1: At the time of this writing, CSS Custom Filters, formerly known as CSS Shaders, are not available in any browser. They were an experimental feature available in WebKit Nightly and Chrome (under a flag) for a