Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #23682 > unrolled thread

How much is possible?

Started bySwifty <steve.j.swift@gmail.com>
First post2014-03-26 06:48 +0000
Last post2014-03-27 21:30 +0000
Articles 3 — 3 participants

Back to article view | Back to comp.lang.javascript


Contents

  How much is possible? Swifty <steve.j.swift@gmail.com> - 2014-03-26 06:48 +0000
    Re: How much is possible? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-03-26 09:21 +0100
    Re: How much is possible? Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-03-27 21:30 +0000

#23682 — How much is possible?

FromSwifty <steve.j.swift@gmail.com>
Date2014-03-26 06:48 +0000
SubjectHow much is possible?
Message-ID<lgtt7e$g0c$1@speranza.aioe.org>
I'd like to use JavaScript to add a row to a table in the parent 
document, if the Remote_Addr is either 127.0.0.1 or 81.2.123.82

I envisage the HTML for the row being read from a local file, preferably 
outside the htdocs directory.

The page in question is what I use as my homepage in all the browsers 
that I use. The row that I'd like to add is a set of links associated 
with online banking. There's nothing in the proposed row that would 
directly give access to my online banking, but just knowing which banks 
is more than I want to expose. By having the JavaScript fetch the HTML 
from a local file, I presume I'll be makig it harder for a remote hacker 
to deduce the content of the additional row.

I know little about file access from JavaScript, other than that it is 
quite restricted.

Is what I'm asking impossible? I'm quite content to forget about this, 
going on as I always have, but that extra row would come in handy.

-- 
Steve Swift
http://www.swiftys.org.uk/

[toc] | [next] | [standalone]


#23683

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2014-03-26 09:21 +0100
Message-ID<XnsA2FC5F3D4A58Beejj99@194.109.133.133>
In reply to#23682
Swifty <steve.j.swift@gmail.com> wrote on 26 mrt 2014 in 
comp.lang.javascript:

> I'd like to use JavaScript to add a row to a table in the parent 
> document, if the Remote_Addr is either 127.0.0.1 or 81.2.123.82
> 
> I envisage the HTML for the row being read from a local file, preferably 
> outside the htdocs directory.
> 
> The page in question is what I use as my homepage in all the browsers 
> that I use. The row that I'd like to add is a set of links associated 
> with online banking. There's nothing in the proposed row that would 
> directly give access to my online banking, but just knowing which banks 
> is more than I want to expose. By having the JavaScript fetch the HTML 
> from a local file, I presume I'll be makig it harder for a remote hacker 
> to deduce the content of the additional row.
> 
> I know little about file access from JavaScript, other than that it is 
> quite restricted.
> 
> Is what I'm asking impossible? I'm quite content to forget about this, 
> going on as I always have, but that extra row would come in handy.

If I understand well, you have a web-url website page with a web-url iframe, 
that wants to access your computer's or any other web-url file?

That is impossible under standard security of modern browsers.
And for good reason.

So better build your own browser for such tasks.

=========================

However, manipulating foreign websites on your own computer can easily be 
done by browser extensions like "shortcut manager" on Google Chrome.

I just tried:

document.body.innerHTML += '<iframe src="http://cnn.com"></iframe>';

to be inserted by typing "ctrl-@". I even could specify the web-url 
urls/pages where this is made possible.

Manipulating that into a code that puts such iframe or perhaps an image into 
an added table-row cell should be no problem, if you know how to work with 
table-DOM.

If that can be done by inserting text from "localhost://", I did not test 
it, but would assume that to be possible.


-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#23714

FromDr J R Stockton <reply1400@merlyn.demon.co.uk.invalid>
Date2014-03-27 21:30 +0000
Message-ID<k12$mH1chJNTFwo4@invalid.uk.co.demon.merlyn.invalid>
In reply to#23682
In comp.lang.javascript message <lgtt7e$g0c$1@speranza.aioe.org>, Wed,
26 Mar 2014 06:48:10, Swifty <steve.j.swift@gmail.com> posted:

>I'd like to use JavaScript to add a row to a table in the parent
>document, if the Remote_Addr is either 127.0.0.1 or 81.2.123.82
>
>I envisage the HTML for the row being read from a local file,
>preferably outside the htdocs directory.
>
>The page in question is what I use as my homepage in all the browsers
>that I use.
> ...


Since it is *your* home page and written by *you*, ISTM that at least
part of EjH's reply is, or can be made, irrelevant.  You might need to
have copies on all of the machines where the extra part is to be seen.
You should be able to carry the stuff in a USB memory stick if you need
to use someone else's computer.

With code assist from EjH himself, I have a private page - the URL is in
an E-mail to you - that adds a line to an existing Table.

Several of my pages read from local files, by way of an iframe (not in
Chrome after about V.4); one of the simplest generally usable ones might
be <http://www.merlyn.demon.co.uk/js-grphx.htm>, but try also my
<http://www.merlyn.demon.co.uk/linxchek.htm>.  Read the instructions
before attempting execution.

I use an iframe to add very private information into a private Web page,
but only when the private page is viewed on my computer directly; I do
not upload the very private part.  If necessary, the URL for the very
private part is only given to the iframe if location.protocol=="file:" .

-- 
 (c) John Stockton, nr London, UK.   E-mail, see Home Page.    Turnpike v6.05.
 Website  <http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
 PAS EXE etc. : <http://www.merlyn.demon.co.uk/programs/> - see in 00index.htm
 Dates - miscdate.htm estrdate.htm js-dates.htm pas-time.htm critdate.htm etc.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web