473,387 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Determining the state of a link

Is there any to tell via javascript the "state" of a link? I mean, I'd
like to be able to tell if a link has been followed or not.

(hehe, I can hear shrill crys of "privacy!" in the distance...)

Jul 23 '05 #1
13 1484
Lee
Razzbar said:

Is there any to tell via javascript the "state" of a link? I mean, I'd
like to be able to tell if a link has been followed or not.

(hehe, I can hear shrill crys of "privacy!" in the distance...)


Fortunately, browser authors generally have more respect for those
"shrill cries" than you do, so no, you can't fill a page with links
to porn sites and build up a database of which I've visited.

Jul 23 '05 #2
Lee wrote:
Fortunately, browser authors generally have more respect for those
"shrill cries" than you do, so no, you can't fill a page with links
to porn sites and build up a database of which I've visited.


On the contrary, it most certainly can be done, for a subset of users with
browsers which support CSS and the necessary scripting capabilities.

See: http://www.mattkruse.com/temp/link_check.html

This is, as far as I'm concerned, a privacy vulnerability.

I could easily add a script to a site which checks hundreds of URLs to
"profile" my visitors without their knowledge, and submit that data back to
the server for storage and analysis.

--
Matt Kruse
http://www.JavascriptToolbox.com
Jul 23 '05 #3
"Matt Kruse" <ne********@mattkruse.com> writes:
On the contrary, it most certainly can be done, for a subset of users with
browsers which support CSS and the necessary scripting capabilities.

See: http://www.mattkruse.com/temp/link_check.html
Ingenious.
This is, as far as I'm concerned, a privacy vulnerability.


At least it seems Opera 8 is not affected. It always returns the color
of a non-visited link. It works for both IE and FireFox, though, and
I agree it's a privacy vulnerability worth reporting.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #4
Lasse Reichstein Nielsen wrote:
[...]
At least it seems Opera 8 is not affected. It always returns the color
of a non-visited link. It works for both IE and FireFox, though, and
I agree it's a privacy vulnerability worth reporting.


Well, it doesn't work for me, and I use Firefox 1.0.2 on Linux...

--
+- David Given --McQ-+
| dg@cowlark.com | "The README of fate is a complex program indeed."
| (dg@tao-group.com) | --- Reboot
+- www.cowlark.com --+

Jul 23 '05 #5
"Lasse Reichstein Nielsen" <lr*@hotpop.com> wrote in message
news:8y**********@hotpop.com...
"Matt Kruse" <ne********@mattkruse.com> writes:
On the contrary, it most certainly can be done, for a subset of users
with
browsers which support CSS and the necessary scripting capabilities.

See: http://www.mattkruse.com/temp/link_check.html


Ingenious.
This is, as far as I'm concerned, a privacy vulnerability.


At least it seems Opera 8 is not affected. It always returns the color
of a non-visited link. It works for both IE and FireFox, though, and
I agree it's a privacy vulnerability worth reporting.


Maybe it's time to start using a user defined stylesheet. Create a file
called userContent.css, put it in your Gecko-based browser's
{profile}/chrome directory (Documents and Settings\<user>\Application
Data\Mozilla\Firefox\Profiles\default.xyz\chrome in Windows 2000 and
Windows XP). Make sure userContent.css contains:

a{ color: Blue ! important; }
a:visited { color: Red ! important; }

In IE:
- Tools > Internet Options > General tab > Accessibility
- Check User style sheet
- Browse for userContent.css

The above methods appears to work in IE, even if the site author
includes ! important in his CSS for links. I didn't test it in Firefox.

Actually, I'm not that paranoid, but for those that are, there appears
to be a way to mitigate the privacy issues without having to switch
browsers.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #6
Grant Wagner wrote:
Actually, I'm not that paranoid, but for those that are, there appears
to be a way to mitigate the privacy issues without having to switch
browsers.


Yeah, I don't think it's that big of a deal. The potential exploits would be
complicated and really not that big of a deal anyway. It's more of a
curiosity than a real concern, for me.

Possible 'exploits' might include:

- Checking popular banking sites to see which bank the user might use

- Checking weather.com URLs for every zip code and possibly finding out the
zip code of the user

- Checking competitor URLs to see if the user has been there recently, and
displaying targetted advertising based on that fact.

- When displaying ads, checking to see if the user has already clicked on
the ad. If they have, display a different one instead.

etc.

I was wondering if there was a way to form URL's that would point to objects
on the filesystem in IE. For example, a URL that points to Excel. By
checking that, you could tell if the user has Excel installed in that
location. But, I don't think people run stuff from within IE. I didn't know
what else along the same lines might be possible.

To me, the "fix" would seem to be that browsers never report the styles
applied by :visited styles. Instead, fall back to the default style for the
<a> tag. That might be complicated, though, and I don't think it would be
high on anyone's priority list.

--
Matt Kruse
http://www.JavascriptToolbox.com
Jul 23 '05 #7


Lee wrote:
Razzbar said:

Is there any to tell via javascript the "state" of a link? I mean, I'd
like to be able to tell if a link has been followed or not.

(hehe, I can hear shrill crys of "privacy!" in the distance...)


Fortunately, browser authors generally have more respect for those
"shrill cries" than you do, so no, you can't fill a page with links
to porn sites and build up a database of which I've visited.


Maybe that's what YOU would do, jerk.. shows what's on YOUR mind.

My purpose, not that it's any of your business, was to allow the user
to clean up a page by moving their followed links to another area of
the page.

So take your insulting insinuation and shove it.

Jul 23 '05 #8


Matt Kruse wrote:
See: http://www.mattkruse.com/temp/link_check.html

This is, as far as I'm concerned, a privacy vulnerability.
Wow, that was scary. Had me fooled for a second, too, because the
followed links appeared no different from the followed ones. Someone
could make the link text very tiny, and hundreds of links could go
unnoticed. The only problem would be in getting the visitor to submit
them.
I could easily add a script to a site which checks hundreds of URLs to
"profile" my visitors without their knowledge, and submit that data back to
the server for storage and analysis.


I knew there could be a privacy issue, and now I'm wondering how to
protect against it, without having to keep clearing the browser
history.

I just wanted to move links from one part of the page to another.
Really.

Jul 23 '05 #9


Matt Kruse wrote:
To me, the "fix" would seem to be that browsers never report the styles
applied by :visited styles. Instead, fall back to the default style for the
<a> tag. That might be complicated, though, and I don't think it would be
high on anyone's priority list.


There could be a browser security setting that would "forget" the
followed status of a link to all sites except the originating one. For
other sites, a tool tip could indicate the followed status.

It's useful to see which links you've followed. I wanted a way to to
actually move them out of the way, or off the page, if the user wanted
to.

Jul 23 '05 #10


Grant Wagner wrote:

Maybe it's time to start using a user defined stylesheet. Create a file
called userContent.css, put it in your Gecko-based browser's
{profile}/chrome directory (Documents and Settings\<user>\Application
Data\Mozilla\Firefox\Profiles\default.xyz\chrome in Windows 2000 and
Windows XP). Make sure userContent.css contains:

a{ color: Blue ! important; }
a:visited { color: Red ! important; }

In IE:
- Tools > Internet Options > General tab > Accessibility
- Check User style sheet
- Browse for userContent.css

The above methods appears to work in IE, even if the site author
includes ! important in his CSS for links. I didn't test it in Firefox.

But the method works works by checking the current style of a link, and
if it is different than the style of a non-followed link, it would be
"caught".

No matter what css the user chooses for links, the script could find it
by having a link to itself somewhere on that page. That link would
always be in a visited state.

So the solution would be to have visited links with exactly the same
css specs as the unvisited ones.

Actually, I'm not that paranoid, but for those that are, there appears
to be a way to mitigate the privacy issues without having to switch
browsers.


By setting the style of visited and non-visited links the same.

So really, there isn't a 'direct' way to tell...

One could also clear browser history before visiting a suspicious page,
too.

Jul 23 '05 #11
Razzbar wrote:

Lee wrote:
Razzbar said:
Is there any to tell via javascript the "state" of a link? I mean, I'd
like to be able to tell if a link has been followed or not.

(hehe, I can hear shrill crys of "privacy!" in the distance...)
Fortunately, browser authors generally have more respect for those
"shrill cries" than you do, so no, you can't fill a page with links
to porn sites and build up a database of which I've visited.

Maybe that's what YOU would do, jerk.. shows what's on YOUR mind.


If Lee is a jerk for worrying about security issues, then you are a
stupid idiot for *not* worrying about them. When you post a question,
you do not always get the answer you wanted. This is not a help desk,
its a discussion group. Get over it.
My purpose, not that it's any of your business, was to allow the user
to clean up a page by moving their followed links to another area of
the page.


Beside every link, add a "move this crap out of my way" link and have
that link move the visited link.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #12


Randy Webb wrote:
Beside every link, add a "move this crap out of my way" link and have
that link move the visited link.


Oh, I can see it now... a page with dozens and dozens of links, some
followed, which the user may or may not be interested in, filling up
the screen. And beside each link, -another- link saying "move this crap
out of my way". So if the user is interested in moving all those links
down to the bottom of the page, all she has to do is go down the page,
clicking them one by one. And beside every "move this crap out of the
way" link, there could be another "move this crap to the top of the
page" link...

I had in mind more like ONE button that the user could click, which
would call a function to loop thru the document links collection.

But your method sounds a lot better. Your way, the user could decide
one by one whether to move a link or not. None of them complicated
looping functions to write. Yes. Let the user decide. We must stop
pornography.

And thanks for letting me know that this is a discussion group, and not
a help desk. I did't know that. I thought people could ask questions
here. Give me time, big daddy, I'll learn.

Thanks, and go have a nice day yourself.

hehe...

Jul 23 '05 #13
Grant Wagner wrote:
"Lasse Reichstein Nielsen" <lr*@hotpop.com> wrote in message
news:8y**********@hotpop.com...
"Matt Kruse" <ne********@mattkruse.com> writes:
On the contrary, it most certainly can be done, for a subset of users
with
browsers which support CSS and the necessary scripting capabilities.

See: http://www.mattkruse.com/temp/link_check.html

Very nice illustration. Notice that the www.mattkruse.com is not
shown as visited. You have to match up the URL pretty nearly exactly.
Ingenious.
This is, as far as I'm concerned, a privacy vulnerability.
At least it seems Opera 8 is not affected. It always returns the color
of a non-visited link. It works for both IE and FireFox, though, and
I agree it's a privacy vulnerability worth reporting.


Maybe it's time to start using a user defined stylesheet. Create a file
called userContent.css, put it in your Gecko-based browser's
{profile}/chrome directory (Documents and Settings\<user>\Application
Data\Mozilla\Firefox\Profiles\default.xyz\chrome in Windows 2000 and
Windows XP). Make sure userContent.css contains:

a{ color: Blue ! important; }
a:visited { color: Red ! important; }

.... The above methods appears to work in IE, even if the site author
includes ! important in his CSS for links. I didn't test it in Firefox.


Just and idea, and I didn't try it, but if I were going after something
like this, I could imagine creating A elements in script, and setting
the visited style inline. Then check the computed style. Heck, with a
little hidden Iframe / server communication you could be testing links
all day in the background.

Csaba Gabor from Vienna

Jul 23 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Cliff Wells | last post by:
Hi, I'm writing an application that needs to know if an Internet connection is available. Basically, I want to have something similar to what a lot of email clients have, where the app can work...
1
by: Tristan Miller | last post by:
Greetings. I am trying to write a function which toggles the display of a certain class of <div> elements in an HTML page. The CSS file initially sets some classes to "display: none", and...
5
by: ~greg | last post by:
I have links on an index page like this: <a href="link" onclick="DoOnClick('link')"> page title </a> -where the DoOnClick("link") just adds a query part to the url before executing: ...
18
by: Robert | last post by:
Hi! I was wondering if the was any way to determine the state of the caps lock key, on or off. Of course I can capture the key events and see whether the caps lock is pressed, but that does not...
7
by: Jean-David Beyer | last post by:
I have six hard drives (4 SCSI and 2 EIDE) on my main machine with parts of a database on each drive. The main index is on one SCSI drive all to itself. The main data are on the other three SCSI...
2
by: Elad | last post by:
Hi, Is there a way of determining whether a Mutex is signaled or not without using Mutex.WaitOne() which blocks the thread if the Mutex currently has an owner? Thanks.
2
by: Ivers | last post by:
My C# asp.net app (.NET 1.1) can generate an email whose body contains a link to the current page of the app. When the recipient of the email clicks the link (usually from Outlook), the app...
10
by: Peter Olcott | last post by:
Someone told me that determining the exact location and current state of any JavaScript controls is pretty easy. Does anyone know exactly how this is done?
1
by: Jeff | last post by:
I need to place a "Previous Page" link on every page within my site and a simple javascript:history.back() will not work because I need it to capture the state of the page when I left it. For...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.