I have created a webpage with some hyperlinks (not online yet).
I'm supposed to include certain hyperlinks for the Email IDs on the page.
I tried to create links in this format:
<a href="mailto:someone#mozilla.org">
But these are not opening up using Outlook's new mail, as it is supposed to.
On Chrome, it does nothing. On Firefox, IE & Safari it opens a new blank Chrome Window when I click on the link.
This system is new and has all the above browsers up to date.
Provided you have registered a default email client, this usually works, if you're using an <a> tag as follows:
Mail me
To change or check the email client settings, do the following (cited from MSDN) - I have modified it slightly because it differs depending on the Windows version you're using:
Depending on the Windows version: Open Default Programs by clicking the Windows Start button, and then clicking Default Programs. Or: Open the Control Panel in the Start Menu *), then use the search text box
in the upper right corner of the Control Panel screen and type Default Programs there. Hit Enter.
Click Set your default programs.
Under Programs, click the Email program you'd like to use, and then click Set this program as default.
Click OK.
Note
The first time you start them, some email programs display a message asking you if you want to use that program as the default. If you choose to do so, this program will become your default email program, even if you've chosen a different program using "Set your default programs" earlier.
*) In , you can find the Control Panel, if you open the Windows menu , then click on the cogwheel icon , then enter Control Panel in the search box.
If you are using Windows 7 or higher, then all you have to do is set the default email client. Check this in the control panel under Default Apps setting.
Just click on the email client you want and you are all set.
The other answers didn't resolve my own question, which was resolved as follows.
I came to this question because I was experiencing the same issue, with properly formatted email anchors failing to open Gmail when Chrome was set as the default email app. The other answer did not work in Windows 10, with Chrome.
In the case of this OP, it seems that Google Chrome is already set as the Default Email app, as indicated by On Firefox, IE & Safari it opens a new blank Chrome Window when I click on the link, and the anchor is properly formatted, because clicking it in other browsers, opens a blank Chrome window.
This is the exact description for my own experience, which brought me to this question.
The HTML anchor does not seem to be the culprit.
To get Send Mail from Send Mail to work in Google Chrome in Windows 10:
Go to Settings, Apps, Default Apps, and under Email, select Google Chrome.
This step alone, does not necessarily work, I had to set the handler, as shown in the following steps, because Gmail was blocked.
In Chrome, go to Settings by selecting
Select Privacy and security on the left side of the screen
Select Site Settings
Scroll down to Permissions and select Additional permissions
Select Handlers
Select Allow sites to ask to become default handlers for protocols
If a site (e.g. Gmail) is blocked, remove the block
Open Gmail in a new tab and sign in
In the address bar, select the
This page wants to install a service handler.
Select Allow, and then Done
Return to the Settings tab, and mail.google.com will be the email handler.
Are you sure you are closing the anchor correctly? The full HTML should be this:
Test
Try something like this:
<!DOCTYPE html>
<html>
<body>
<p>
Click to email :
someone#mozilla.org
</p>
</body>
</html>
Related
Debugging a page where I see that there are two calls made to the page, one is the initial call and one is made when the first has been recieved and the browser parses the document. I am however having trouble finding the source of the second call. I have built the javascript i dev mode so I have sourcemaps but the call seems to be originating from the html code itself. Looking in the Network tab of devtools I see this
in Chrome and this
in Firefox
Firefox seems to identify the Initiator as image but no more details as to what image.
What should I look for in the code to find the source of the call? Is there something else I can do to get more details of where the call is made from?
Update:
Clicking the initator item in Chrome marks the first Doctype line in the document
That the request is recognized as an image is an indication for either an <img> HTML element or a url() CSS function that has a URL that references the document itself instead of an image.
Check the HTML
From my tests, this does not happen when the src attribute is empty but it happens when you set it to an anchor on the page.
So, in order to find the culprit, go to the Inspector (Firefox) or Elements (Chrome) panel, press Ctrl+F (Windows, Linux) or Cmd+F (macOS) and search for img[src^="#"]. That finds all <img> elements that have a src attribute with a value starting with a hash.
Check the CSS
Browsers (incorrectly) send a network request when the CSS url() function is set to an empty string, i.e. url(), url(''), or url("").
To check whether it is set within the style attribute of one of the HTML elements, search for url('') and url() within the Inspector as described above.
If it cannot be found there, you need to search within the style sheets.
Chrome
In Chrome this is possible by pressing Ctrl+Shift+F (Windows, Linux) or Cmd+Shift+F (macOS) while the focus is within the DevTools. Doing so opens a search tool that allows to search across all loaded sources. Type url('') in there and hit Enter. If nothing is found, try it again with url("") and url().
Firefox
In Firefox there's no such global search yet (as of Firefox 85), unfortunately. Though there are two ways other ways to search through the style sheets.
Via the Style Editor
The Style Editor allows you to inspect the style sheets, though you have to search in each one separately by selecting it at the left side and then pressing Ctrl+F (Windows, Linux) or Cmd+F (macOS), typing url(), url(''), or url("") and hitting Enter.
Via the Network Monitor
There's a feature that allows you to search through the network request reponses within the Network Monitor. Click the magnifying glass button, which opens the search tool. In the input field type url(), url(''), or url("") and hit Enter.
I have a website that is JavaScript-heavy and requires user to record their videos, When I send my emails to my customers the link opens in gmail's in-app browser which you cannot record from, Plus there's many functionalities missing.
How to trigger a popup when user clicks the links in the email to select whatever browser they wants instead of gmail's in-app one? I've seen some people do that I tried and did some research for it but not results.
By default a web browsers cannot open a rival's web browser. This would be a security risk. There are hacks which involve the user downloading an add-on or extension. See answer in stackoverflow.com/questions/10070744/open-ie-browser-in-firefox-chrome-page
The popup you're referring to are most likely apps. The user would have to granted permission. (This I don't have experience with).
It looks like there is no way to programmatically force emails on Android to open in Chrome browser. The user has to alter their system settings. Therefore, an alternative approach may be to educate the user (about the loss of functionality). This can be done by preforming browser sniffing & displaying an appropriate message at the top of the webpage.
With JavaScript, you can test if a function is supported & enabled by creating functions. Below is an example, which determine is LocalStorage is available. (It's only for illustration purposes).
function isLocalStorageEnabled(){
var test = 'test';
try {
localStorage.setItem(test, test);
localStorage.removeItem(test);
return true;
} catch(e) {
return false;
}
}
if(isLocalStorageEnabled() === true){
// available
}else{
// unavailable
}
Also I believe there is no single way to detect if the user, is using Gmails built-in browser or Chrome. However based on the following factors, you can assume they're using Gmail if:
User has clicked an email link. (You can append a query string. On landing on site, store in session and redirect without the append query string).
User is on android (/Android/.test(window.navigator.userAgent)).
User is on Chrome (see answer stackoverflow.com/questions/4565112/javascript-how-to-find-out-if-the-user-browser-is-chrome/13348618#13348618).
The web browser doesn't support some sort of JavaScript function, which works on Chrome but not on Gmails browser.
If all criteria are true, then you can then display a message like: For full functionality, please use Chrome or alternatively in Gmail: Go to Settings, General, and uncheck the option to open links in gmail (and reopen link from Gmail).
Note: browser detection can be faked. However this should be fine for displaying messages.
The option to send links in the Gmail (or any app) WebView to the system handler is reserved for the app itself.
The implementation for apps is described here:
WKWebView open links from certain domain in safari
WebView link click open default browser
However, if you instruct the recipient to long press the link in the email, there is an option to open the link in browser and that will take them to the default browser.
I have a html page with several links to files with various file types, such as pdf, csv, and zip. Depending on the available browser plugins, some of these files can be opened inline by the browser, whereas others will be downloaded.
I don't want such links to open in the current tab, so each one has the attribute target="blank".
This works fine in most browsers:
When the user clicks on a link to a file that can be displayed inline, the file is shown in a new tab.
Otherwise, a new tab is opened and immediately closed as soon as the file starts to download. The user stays in the current window.
In Microsoft Edge, however, the second case does not work: the new tab remains open. This is annoying, because the user is now looking at a useless empty tab.
Is there any way to prevent this from happening?
I don't think there is anything you can prevent Edge's this behaviour. What you can do is to change the HTML tag.
Use download attribute in <a> element without target attribute. This way, the browser will prompt save dialog instead of opening a new tab.
<a href="myfile" download>Download</a>
http://www.w3schools.com/tags/att_a_download.asp
In this case, the browser will not display the file inline.
If you still want your clients be able to see the files inline you can detect the client's browser; if it is Edge then use the download attribute, if not use target attribute. In addition, you can use something like navigator.mimetypes to detect which file types can be displayed inline (see https://developer.mozilla.org/en-US/docs/Web/API/NavigatorPlugins/mimeTypes).
Here is the detect function which I took from another post (How can I detect Internet Explorer (IE) and Microsoft Edge using JavaScript?)
function isEDGE(){
return /Edge\/\d./i.test(navigator.userAgent)
}
Leave your <a> tags with no target and download attributes. Use detect function and decide on the right attribute.
Like this:
$(document).ready(function(){
if(isEDGE()) {
$('a').attr('download','download');
} else {
$('a').attr('target','_blank');
}
})
Note:
I am not sure about Edge detecting function.
Method 1:
I suggest you clear the Clear browsing data option of Microsoft Edge and check if you face the issue. To do so perform the steps below.
Click on the More actions icon next to the feedback icon present on top right corner of the Edge.
Select Settings and click on Choose what to clear.
Check the boxes Browsing history, Cookies and saved website data and Cached data and files and click on Clear.
Method 2:
If you are using any Proxy connection, then try disabling the proxy connection and check.
Follow the steps to disable proxy:
Click the Settings icon at the top right corner in internet explorer.
Click the Tools button, and then click Internet Options.
Click the Connections tab, and then click LAN settings.
Uncheck the box next to “proxy server for your LAN”.
Click on OK to save the setting and close window.
Now check the issue by opening Edge.
I am developing a web site where users can change settings which they have to confirm before taking effect.
The confirmation is done by a link I send them via E-Mail. In the HTML of the website I use this little snippet:
<script type="text/javascript">window.name="mysite";</script>
And in the HTML emails I use
Click me
But Chrome is always opening new tabs instead of opening them all in one.
Is this even possible or is it forbidden for some reasons?
Webmail platforms such as Gmail tend to modify some of the HTML code of an email due to security reasons.
They obviously remove any javascript code the email could have. But they also change (or add if none) the target property of every anchor element and set them to target="_blank" in order to avoid the user to be taken out of Gmail (in this case).
Unfortunately every webmail platform has their own behavior, therefore, what you want to do is not gonna work on every webmail platform.
If what you want to do is prevent the user from having multiple tabs of the same page opened, (*please refer to Update 1) it comes to mind you could use web sockets to close the previous tab once the user enters in the URL sent by email. Have a look at socket.io for example.
Update 1
There's no way to do this using WebSockets. There's no possible way to close a window that wasn't opened using javascript, and it can only be closed by it's parents.
That is a very interesting idea. I like it. Alas, it appears that, in modern browsers, you can no longer close a window you didn't open through javascript. So if you aren't allowed to run javascript in the email, the best you can do is to redirect the original page to a "thank you" page and leave it hanging around in the browser's tab (but no longer waiting on conformation). Like this:
PleaseConfirm.html:
window.name="need_redirected";
Confirm.html:
var w = window.open("", "need_redirected");
if (w)
w.location="ThankYou.html";
Of course, for old IE, I'd still try to close the old window in ThankYou.html:
window.top.close();
You can still try to set the target, of course, just in case it works, and you can always try putting an onclick attribute on your tag for the same reason:
click here
But that seems to be the best you can do. Bummer.
Neither of the other two answers work, but this one probably will:
In the initial tab, listen for an onstorage event, with a certain key being created, e.g. "userHasConfirmedEmail". When the event occurs, window.top.close().
In the new tab, create that key.
Credit goes to Tomas and his answer.
I am using Outlook Web Access in Chrome and Firefox. On OS X, the webpage uses the keyboard shortcut Option+S for sending off the email. Unfortunately, on OS X the same shortcut is usually used to type the German Umlaut "ß". Hence, whenever I now try to type a word with that character, the website instead sends off my email. Do you know of any plugin or other means to disable such shortcuts on certain websites? Thanks!
You can tell Firefox to disable all keyboard shortcuts for websites (as well a couple other options). Look at this pref on the about:config page.
permissions.default.shortcuts (default = 0)
The values can be set as follows:
UNKNOWN: Services.perms.UNKNOWN_ACTION [0]
ALLOW: Services.perms.ALLOW_ACTION [1]
BLOCK: Services.perms.DENY_ACTION [2]
PROMPT: Services.perms.PROMPT_ACTION [3]
Note that there may be some undesirable side effects, e.g. my fn+delete macOS System function no longer works to delete the next character after my cursor... maybe there's a workaround for that?
I found this solution here:
https://support.mozilla.org/gl/questions/1241294
More context:
I had a similar problem with Outlook Web App (OWA) in Firefox on Macbook (OSX), where I want to refresh the page with cmd+r but instead OWA would interpret the shortcut as "reply" and pop-up a new window to reply to the selected message instead of simply refreshing the page.
Use an OS level tool, such as Automator, to toggle the keybindings based on the browser URL:
A guide to using OS X’s Automator to create your own software
Webkit/Safari/Firefox/API: Can I programmatically read/extract multiple tabs' URLs?
Is there a way to trigger a Hot Key/Keyboard Shortcut via a Shell Script, a AppleScript or a Automator Workflow?
MacOS, how to delete unused service item in Keyboard Shortcuts