TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: 'Hack' the user cursor

267 pointsby javierbyteabout 8 years ago

26 comments

jamesfisherabout 8 years ago
This hack works by disabling the real cursor (using a custom CSS cursor image set to a transparent png), then moving around a fake cursor image using JS.<p>See by comparison this hack I made a few months ago [1], which uses a dynamic CSS cursor image (drawn in JS). The interesting thing it shows is that CSS cursors can escape the viewport, leading to possible security issues.<p>[1]: <a href="https:&#x2F;&#x2F;jameshfisher.github.io&#x2F;cursory-hack&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jameshfisher.github.io&#x2F;cursory-hack&#x2F;</a>
评论 #14126475 未加载
评论 #14124854 未加载
TheAceOfHeartsabout 8 years ago
Interesting trick. I was recently looking through Safari CSS Reference and thought using an image to replace the cursor wasn&#x27;t allowed: &quot;Although the CSS specification allows it, Safari does not support custom cursors.&quot; [0]<p>What are examples of legitimate use-cases for supporting custom cursors? If you&#x27;re considering using a custom cursors, keep in mind that not all users keep the normal cursor size. At least on macOS, you can increase the size from the Accessibility panel.<p>Hopefully the web can start providing access to more built-in accessibility features. One such feature that was added recently is Reduced Motion Media Query [1]. Wouldn&#x27;t it be great to have a media query for &quot;Increase contrast&quot;? I can&#x27;t be the only one that&#x27;s occasionally frustrated from websites that mix 50 shades of barely readable gray.<p>[0] <a href="https:&#x2F;&#x2F;developer.apple.com&#x2F;library&#x2F;content&#x2F;documentation&#x2F;AppleApplications&#x2F;Reference&#x2F;SafariCSSRef&#x2F;Articles&#x2F;StandardCSSProperties.html#&#x2F;&#x2F;apple_ref&#x2F;doc&#x2F;uid&#x2F;TP30001266-cursor" rel="nofollow">https:&#x2F;&#x2F;developer.apple.com&#x2F;library&#x2F;content&#x2F;documentation&#x2F;Ap...</a><p>[1] <a href="https:&#x2F;&#x2F;developer.apple.com&#x2F;library&#x2F;content&#x2F;releasenotes&#x2F;General&#x2F;WhatsNewInSafari&#x2F;Articles&#x2F;Safari_10_1.html#&#x2F;&#x2F;apple_ref&#x2F;doc&#x2F;uid&#x2F;TP40014305-CH12-DontLinkElementID_61" rel="nofollow">https:&#x2F;&#x2F;developer.apple.com&#x2F;library&#x2F;content&#x2F;releasenotes&#x2F;Gen...</a>
评论 #14125290 未加载
评论 #14125086 未加载
评论 #14125047 未加载
评论 #14125713 未加载
评论 #14125027 未加载
Mystrlabout 8 years ago
I&#x27;m seeing a block box where my cursor actually is. Chrome 57.0.2987.133 (64-bit)
评论 #14126242 未加载
评论 #14125188 未加载
评论 #14125189 未加载
ohadronabout 8 years ago
Nicely done. Not to give anyone any ideas, but the &#x27;gravity&#x27;&#x2F;&#x27;attract&#x27; mode could be used for some very dark UI patterns.
评论 #14124714 未加载
评论 #14131032 未加载
评论 #14126472 未加载
评论 #14125144 未加载
Aldo_MXabout 8 years ago
It could be fun to use the repel effect with a newsletter opt-out.
评论 #14126616 未加载
评论 #14126115 未加载
bluepnumeabout 8 years ago
Pretty smart once you figure out how it works. Wonder if there&#x27;s some kind of advanced click-jacking attack you could achieve with a technique like this.
评论 #14124798 未加载
评论 #14124855 未加载
panicabout 8 years ago
Try turning on &quot;attract&quot; and moving your mouse to click the button from far away. It&#x27;s much easier than moving your mouse to a normal button!
评论 #14125272 未加载
biggerfischabout 8 years ago
In latest Firefox, I keep getting it to show the real and fake cursor by switching tabs, hovering a link in another tab, and switching back. Doesn&#x27;t work every time though.<p><a href="http:&#x2F;&#x2F;i.imgur.com&#x2F;eMg5tXR.png" rel="nofollow">http:&#x2F;&#x2F;i.imgur.com&#x2F;eMg5tXR.png</a>
Aardwolfabout 8 years ago
If you shift+right click in firefox (and keep the menu open but ignore it), you can see both the real and fake cursor at the same time to see what is really happening<p>I like how it seems to work like a vector field
Fry-kunabout 8 years ago
Trick doesn&#x27;t work on Firefox 52: original cursor is visible as well as the fake one Works on Chrome, though
评论 #14124802 未加载
19eightyfourabout 8 years ago
Having a look at the poster&#x27;s github reveals this person has a lot of good stuff. Very creative and clever.
askjdlkasdjsdabout 8 years ago
This is pretty ingenious. I wonder if something like this can have an effect on call to action click rates. But I guess if the user notices then they&#x27;re more likely to be pissed.
jv22222about 8 years ago
This could be used as a good game mechanic. Nicely done!
wingerlangabout 8 years ago
It was fairly obvious how it worked for me since the cursor image was blurred <a href="http:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;XdL4u" rel="nofollow">http:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;XdL4u</a><p>OSX non retina
sml156about 8 years ago
The repel was the funniest things I have seen all day.
cyberferretabout 8 years ago
Two words - &quot;Delightfully Annoying&quot; !! :)
Sunsetabout 8 years ago
Illusion is broken if your default mouse cursor is in a theme like the &quot;inverted&quot; one (windows).
lutuspabout 8 years ago
This would be great in voting terminals. Everything seems normal until you try to vote for someone hackers don&#x27;t like.
arsabout 8 years ago
On Firefox I get two cursors, I&#x27;m unsure which is the one that will actually do something if I click.
gruezabout 8 years ago
Is this broken for anyone else on firefox? I see both the fake cursor and the real cursor.
emmelaichabout 8 years ago
I did a similar thing at work by moving the link away randomly from the real cursor.<p>I was sick of people following their long stale bookmarks and needed to establish the new link.
thenormalabout 8 years ago
So much fun I had, thank you ;)
tobyhinloopenabout 8 years ago
This made me smile
fapjacksabout 8 years ago
Great for sites with ads!
red023about 8 years ago
Thats a awesome idea.
jlebrechabout 8 years ago
useful for a &#x27;buy it now&#x27; button