Is it possible somehow to find out if an external email client has actually been opened when a user clicks on a mailto link on a web page? I need to know that in my javascript code.
The reason I need to know this, is because users might not have any email clients set up on their machines, and they would wonder why doesn't anything happen when they press on the "Send an Email" button.
JavaScript has no access to anything outside the browser. Because of this, there is no way to check the results of clicking a mailto link.
Whatever happens if a mailto link is clicked is up to the clients browser.
Maybe there is some hack to archive what you want, but no standard compliment solution.
Related
I made a webpage which can provide some direct downloads. Therefore I only want real human, not crawler, to download my files. I tried to use Google reCAPTCHA but it is part of the webpage - visitors can still use the download links and doesn't have to worry about the reCAPTCHA at all. Is there a way to mandate visitors to pass the verification first? For example, is it possible to pop up reCAPTCHA before the whole page is loaded? If that's doable, how can I do it? Thanks!
What I can recommend here is the captcha form be on the current page that you have and create a new page with the download links that's not indexable.
Upon authorizing the captcha code, use header('Location: download.php'); or something similar to redirect the user.
A captcha before loading a webpage is possible, but it always uses client side code such as javascript which bots can easily bypass.
In my email inbox I got URL(http://localhost/sample.aspx) of a website when I click on this link this website open in browser.
Now I have to track on sample.aspx that this website coming from link clicked in email through JavaScript.
How can I track that.
For example using document.referrer we can track last visited website URL.
Thanks
The only mechanism you have for this would be to add a parameter to the querystring, so something like http://localhost/sample.aspx?emailClicked=true
You can then read this on the web site using JavaScript (or anything else for that matter) and track it as you see fit.
You cannot use Document.referrer. Because nothing referrered this link (in the case of outlook for example) or if it did (for example gmail, etc.) you don't know what the URL(s) of the hundreds of referrer's would be.
I'm using the Telerik RadWindow control in one of my applications. When a user wants to authorize Twitter for the application the window displays the OAuth dialog for Twitter.
However, each time I display the pop-up for Twitter OAuth, or even just the plain Twitter page, the entire browser is redirected.
The control works just fine when the URL is pointed at a site other than Twitter. I'd like to see if I can block that redirect, or if perhaps there's an easier way to accomplish the OAuth confirmation. Any advice on how to implement this functionality would be greatly appreciated.
Thanks in advance.
This behavior is probably caused by Twitter. In fact, it should happen on many other sites as well (Facebook and similar). To prevent malicious sites from stealing user passwords, the login page detects if it is displayed in an inline frame (IFRAME element, such as the one used in RadWindow) and if it is, the whole browser window is redirected. This way they can ensure that no rogue JavaScript will be running while the user enters their username and password.
Twitter has properly created their authorization page to prevent cross-site scripting attacks, which means you can't embed it in a frame, or javascript pop-up.
Unfortunately, the only other way to "authorize" is a full redirect, or with a pop-up window, assuming your users allow pop-up windows.
The problem with the pop-up is that you then need a way to "close" it when twitter redirects back to your application. It can be done, but it's a bit tricky to do and who knows if it'd work in multiple browsers. Best to just let your site do a full redirect for now.
I want to write a script which will click a button on an external website (one which belongs to someone else). The button is defined as follows:
<input class="btnAdd" type="image" src="/superstore/i/b/btnAdd.gif"
id="i61109534-a" onclick="return a(61109534);">
Basically I want to have a button on my website that when pressed, redirects the user to the external website and automatically triggers the above onclick event. I have been using PHP so far but don't mind if the solution is using Javascript or anything else for that matter!
As far as I know, that's how most tracking, ads and put-a-widget-in-your-site systems work. You just need to insert a call to the *.js file where the function is defined. From the source code of StackOverflow:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
Of course, you must kind of trust the remote site...
That's generally a bad idea, for security reasons. Think of it the other way around: how would you like it if anybody could send users to your site and automatically click the "Logout" button (or, worse, the "delete account" button)?
If you need to do this, you'll need to be able to change the external website. For example, you could link to "http://external.website.com/page?auto_click=button_id". Then you'll have to change the external website's code to automatically click a button when the "auto_click" variable is set in the GET request.
It cannot be done in PHP, as PHP executes server-side and has no control over the user's browser.
JavaScript would be your only solution, but what you're proposing to do is a massive breach of security and explicitly disallowed by design. It cannot easily be done, short of finding a vulnerability in the site you're linking to and injecting JavaScript into that page.
You might be able to accomplish something similar by including the other page in a frame/iframe, but I don't think that's allowed if the pages come from different domains; see cross-frame scripting.
I use Silverlight and I'm trying to get some data to the user side. I can easily display PDF file with an <embed> tag in the browser.
However, I also have to be able to save files form the server. I tried the SaveFileDialog from Silvelright but it doesn't allow setting the file name (which is an issue).
I tried setting a hidden <iframe> source to the URL from the server but that triggers a security warning and it's not good either (there would be too many clueless users calling because it doesn't work).
I tried calling window.open to trigger a new popup set to the URL. That works OK but again there's a security warning.
Is it possible to get rid of that security message? I know it's possible in Javascript.
An exampel is on the site
http://livetecs.com
(go to the live demo, then project manager and open a report in a new window: no security warning!)
How do they achieve that behavior?
If there's any other way to get my reports saved Silverlight I'd be very interested to hear about them.
EDIT: The warning I'm talking about is the Pop-up blocked. To see this pop-up or additional options click here.. banner appearing on top of the page.
Cheers.
There is no way around the pop up blocker when you open up a window without a user action. If there was a way around that, than the pop up blockers would be useless.
Only way to avoid the security message is to have the users add your site to their safe list.
OK, after much fiddling I came accross the Silverlight built-in pop-up window that I couldn't use before.
The only limitation is that it can only be triggered by a user action (which is fine in this context() PopUpWindow at MSDN
It fits the bill perfectly and I couldn't use it before because I wanted to pre-generate the report files before opening the pop-up (and thus I wasn't in a user event context anymore).
I'm going to create a report generation page that will display a status message and then show the report (I haven't worked out yet how I'll do that though).