CSS Copy and paste problem - css

I've developed a system in my application where emails are picked up with a regex, and then reversed in the source (to thwart bots). I then add the span class 'obfuscate email'. I then use CSS to reverse the the text back to be displayed and Javascript make sure that mailto: links still work.
I was pretty happy with my solution until I realised that copying and pasting the email puts it in the clipboard backwards. I was wondering if there was any way I could remedy this? I've been testing in Firefox 3 for OS X.
The page in question is available here: http://www.leaklocations.com.au/contact-us/
To see the problem, simply copy and paste the email on that site.

You can use the same Javascript to reverse the text as well as the mailto links. If the user doesn't have Javascript, then you can either settle for this problem or use an image.

I personally think it's going a bit over the top, but if you really want to obfuscate the address, why not obfuscate it in a human readable way? Instead of reversing the address, make the server output "info at leaklocations dot com dot au" and get javascript to fix it up?
If you wanted to stick to using the RTL CSS method, you could try playing around with the unicode character to reverse text: \u202E I'm not sure if that will help, but it's worth looking at
To see how this works, run this javascript:
alert("one \u202E two \u202E three")
and it'll output "one owt three"

Seriously, is it worth all this effort to obfuscate email addresses? Once the email makes it into a spammer's hands, it's all over. Better to have a good spam filter instead.
And if you use JavaScript to reverse the email addresses back again you are adding extra work for the browser on page load. If JavaScript is turned off or a user is on a mobile device that doesn't support JavaScript, they are screwed too.

Why not use something like MailHide from the reCaptcha folks to hide email addresses instead?

Related

Display Optional Content for AdBlock Users on WordPress

I am trying to set up some sort of conditional, non-intrusive text box that shows up only for people using AdBlock. I am adamantly and emphatically opposed to popups or locking the content of my website to AdBlock users. I simply want to have a small section of plain text show up that says, “Hey, you! Before you read on, we ask that you consider whitelisting us on AdBlock. (etc. etc. etc.)”. I want people to be able to scroll past it without issue and not have their experience with my website be impacted if they choose not to whitelist me; I'm not out to coerce anyone or annoy anyone, I just want to make my case, in brief, that I don't run obstructive, malware-filled ads and it would be great if they supported me. And I don't want it to show up if someone doesn't have Adblock enabled.
I'm not very savvy with HTML, but if someone can clearly instruct me where exactly to put some code in to my website, I would be open to an option that involves editing my website's code. Otherwise, a plugin that I've overlooked would be really helpful. I've looked around but most of what I've found is something that puts a giant sticky on the page to obstruct peoples' view until they whitelist. Again, I don't want that. That is exactly the reason people got AdBlock to begin with. People who use such countermeasures are fundamentally missing the point. (/rant)
Thanks in advance!
Use this plugin.
https://wordpress.org/plugins/ad-blocking-detector/
Read this article:- https://www.wpbeginner.com/plugins/how-to-detect-and-stop-adblock-in-wordpress/
Hope its working for you. try this and let me know

square symbols appearing instead of spaces

I am working on a Wordpress site with the Lambda theme. On the client's computer (Chromebook) some spaces in the text are appearing as square symbols instead (but not all of them...).
I have been unable to recreate this issue on any computers, tablets or phones at my end... Here is what they see: screencap from client
Does anyone have any idea how to fix this?
Thanks so much
Squares mean the client can't read the character code. Chances are it's not actually a space. It's possible one is using one method of encoding and the other is not. Make sure they are both set to the same (e.g. UTF-8)
I can't find the lambda theme with my Add New Themes Dialog. I see them on the web. I wonder if they have recommended plugins that add new fonts to your system that you haven't loaded.

Disable print, print screen, right click using asp.net

How to Disable print, print screen, right click using asp.net
You cant. You cannot avoid content being copied from your pages.
Disabling Right Click is possible, but it doesnt solve your 'problem'. The user could still copy your image, by disabling javascript or just inspecting the source.
And even if you could disable those keys, the user could still just make a photo of his monitor. Good luck disabling that!
Short answer: You don't. You are writing a web application; features of the underlying platform are outside your scope, and you have no business trying to fiddle with them.
Long answer: You can try to capture those keys using javascript, and override the default behaviour, which will somewhat stop very naïve users, but all it takes to disable this "security" is to turn off javascript. Even if you come up with more sophisticated "protection", the essence remains: You are sending content to the client, and once it gets there, it is out of your hands. Given suitable tools (wget is enough for most things), anyone can copy and modify your content in any way they like. Similarly, whatever can be shown on the screen inside a browser can be captured and saved. There is no way around it. If you don't want your content copied, don't send it.
Forget about it. You will irritate your end users who will find a way to con you and do what you didn't want them to do. Forbidden fruit is always the sweetest. By telling them explicitly "you cannot do this", they will wonder why do you want to guard your content and they might try even harder to do stuff you otherwise wouldn't want them to do.
Psychology and technology are against you in this case.
Printing
You could disable printing (well sort of - it's not 100% effective) using a "print" style sheet.
I have not tried it myself, but here is a link that could get you started: http://webdesign.about.com/od/advancedcss/qt/block_print.htm
Print screen
Print screen is something that is typically controlled by the operating system not the browser nor webpage. So you are unlikely to be able to stop this. However, casting my mind back I remember a time (perhaps a long long time ago), where you couldn't take screen shots in Windows (maybe Windows 98) of videos... so if your really in need of disabling print screen - perhaps you could perhaps encode your content in a video... but this will have many many downfalls - namely accessibility, search engine optimisation and it being a royal pain to do... so I wouldn't recommend it under any circumstance.
Right screen
Right click you can disable, but not using a server-side technology (such as ASP.net) instead in a client-side technology such as javascript. A quick search in your favourite search engine will find some help. But disabling right click is rudimentary to get around, so it is not full proof.
An alternative to protect your content is to possibly investigate "rights" in PDFs. I believe you can disable the "right" to print.
However none of these solutions are going to be full-proof. As long as you are making your content available to an end-user on their own computer, there is always going to be a way around your restrictions.
I have implemented for disabling printing using window.onbeforeprint()
Refer this Answer

I don't want to display back and forward button in my browser. Is there any solution apart from popup trick?

customers does not want to allow user to use back or forward button. Just a clean page without commandbar and toolbar, same for FF an IE.
Disabling them is not an option as now.
You cannot change that kind of thing in a existing window -- the only way you can make those disappear is by opening a popup, specifying they should not appear in that popup when it's being opened.
Still, note that you should not try to disable those buttons nor have them disappear : your application should work fine with them, handle their actions -- after all, it's one of the few things users have understood in browsers...
And as a user, this is disturbing and annoying :
I don't like popup windows -- and I'm not the only one who doesn't
I don't like when a website tryies to take control over my browser
It will not always work anyway.
And, as a sidenote : even if the back/forward buttons are not displayed, users can still use Ctrl+left/right or some kind of equivalent !
I know this is not easy, but a part of your work as a web-developper is to explain your clients how Internet and web-applications work... not the same way as desktop applications !
If you can force your users into IE (can't believe I'm suggesting use of IE!) you can do this trick. Try running this from the command line
"C:\Program Files\Internet Explorer\iexplore.exe" -k
This will force IE into kiosk (or full screen mode), similar to pressing F11 when in a usual browser session.
PS. I agree with the other answers suggesting this should be discouraged but there are instances (such as when the end user really can't be trusted) that this is a good solution.
No, there's no other way.
However, this is extremely annoying behavior and should be greatly discouraged. This isn't a code issue to solve...this is behavior that shouldn't be implemented at all.
My opinion here, you have a client problem not a code problem. Whatever standard is the expectation, and the user has the expectation of having their back/forward buttons, break that and you break their experience.
Ever see a Windows application that removes the taskbar? That's the equivalent...
I don't think there is a reasonable way to disable the behavior. You may get rid of the buttons in various ways, but the behavior is still there (through keyboard commands, popup menus and so on).
The only reasonable way is to make your web application follow web semantics, and make the client realize this.
many web based ERP (for example) does not tolerate people using navigation buttons. BUT these web applications handle the fact people use these buttons and do not crash. That's what you should do. If each time people use the back button, they get an error message, they will quickly stop using it.
The solution that used to work in IE was adding a startup script with one line:
location.forward();

In-text hyperlinks shown by Internet Explorer without the following space. What can be the reason? YUI?

I've a problem which is most likely some ugly CSS mistake, but I just can't spot the solution (and a few changes I tried did not help).
Some of in-text hyperlinks (not all!) are shown by Internet Explorer without the following space.
here is the example
See the link WatchBot just below the Rationale title (and a few similar links deeper in the article). Firefox, Opera, Chrome, Konqueror - all display it properly: WatchBot can. IE (6.0 but IIRC also 7.0) displays it as **WatchBot***can*.
I am using Yui-reset and yui-base. Is it possible that those libraries cause the problem?
Do you have a script running on, and altering, the content in any way? I say this because the page loads normally initially, but looks as though it undergos some modification later in the loading lifecycle.
If you think reset or base are making this happen try removing them one at a time - I haven't had any experience of this error before however (I usually use the full whack: Reset, Grids, Base and Fonts).
What I did notice however is that the first WatchBot link of the page is simply this:
<p>Have you ever been curious how is
WatchBot
picking the games to observe and save? Here is the explanation.</p>
Where as the second link looks like this:
<span>Due to the FICS limitations </span>
WatchBot<span> can
I have no idea what that second span is doing there - might be something to check up on. (It validated fine however - so there's definitely an closing span somewhere).
I'd say a good place to start would be to but a space after the anchor but before the span, rather than right after the span start tag.
Current state of the things: as steve_c spotted first, and buti-oxa confirmed, it looks like the layout is being spoiled by javascript (and as Ross noted, some extra spans are injected). Thank you all, I missed it.
I am to make experiments and selectively disable those scripts (analytics and google ads) to check whether it helps (my current bet is that maybe I have some HTML error or naming conflict)
Did you try to disable pageTracker? It seems to be the only script on your page, and it looks fine to me in its static form.
EDIT: I wondered what span Ross was talking about - I did not see any. I viewed the source. I just learned that Firefox allows to see both source and generated source (Toos/Web Developer/View Source). Sure enough, generated source has additional span inserted.
Solution: my page was spoiled by the text-link-ads script (which, in fact I activated on English blog by mistake - this is script by adkontekst.wp.pl, Polish firm). After disabling it everything is OK.
Thanks for everybody who pointed me into the right direction.

Resources