On Mon, 28 Jan 2002 15:58:19 -0400 Clarence Verge <[EMAIL PROTECTED]> wrote:

> On Mon, 28 Jan 2002 20:33:37 +0300, Mithgol the Webmaster wrote:
> 
> > Let's hope Arachne will be upgraded soon.
> 
> Perhaps you would like to contribute in the form of a minimal
> js masquerade engine ?
> 

Sounds good. Let's discuss what should it be. I am busy right now, but in early
February I'll think about making a standalone DOS16 executable (.EXE)
JavaScript preparser (with open source code Turbo Pascal 5.5/6.0 .PAS) - a
program which parses original HTML and makes one of the following:

1) .ASF with a single URL where Arachne should go to
2) .HTM, free of JavaScript, which Arachne should browse

but this tends to be not so fast solution, since it needs an external APM
helper instead of plug-in engine. But it will do masqerade, since most guardian
JS will either send a browser to another MSIE-only page via JS or change a
hidden value in 
a certain form.

But. You should give me several examples of websites where Arachne should
masquerade; the browser detection methods DO vary. I'll invent the most common
and quick masquerade solution for each. 
Or describe a DOM component, if you agree with the following.

> Lacking that, how about creating a document describing each of
> the most important and absolute minimum js functions listing the
> form of the function call and a description of the required
> MINIMUM action ? 
> Please don't suggest I/we review the standard ourselves. Do you
> want to contribute ? 
> 

I won't suggest that. I can make a complete list, but JavaScript is an
object-oriented language and its function calls may address to some DOM
(Document Object Model), which may include (but is not limited to) the
following browser-detection functions:

*) automatic navigation through pages in Arachne history or sending Arachne to
a new URL
*) content read/written in forms
*) new string or numeric objects created in memory
*) new HTML code written in the place where SCRIPT tag is placed; this code may
also include SCRIPT tags, so it needs a recursive interpreter
*) external java scripts downloaded from Internet and interpreted

> Forget complete js support for now - it is NOT going to happen.
> Even to get limited functionality, we will need some self-critical help.

Okay, I'll help you. But it's like Turing test
http://www.loebner.net/Prizef/TuringArticle.html

To imitate JS capabilities, Arachne should have at least limited DOM. Otherwise
it will not be possible for JS to redirect Arachne, or to modify some hidden
(or not hidden) data in forms sent to server - if it is server where the
decision takes place about JS capabilities.

Let's implement a basic DOM; it could be as simple as... well, 
I don't know English enough to be really metaphorical. Implementing a simple
DOM in Arachne is really simple. Rendering a hierarchy of standard objects, one
by one, is exactly what was first introduced in Netscape 3.0.

If you know C++ or Turbo Pascal 5.5 (or higher), or Delphi, or Java, or any
other object-oriented language, you can make Arachne capable of JS.

Let's begin with the following:

*) Assigning a string to document.location (a location property of document
object) makes a redirection; string is interpreted as full or local URL.

Example: 
document.location = "http://arachne.cz/";; // like C++ syntax

More example:
document.location = "msie_index.html"; 
// browser will travel to some other page, local on the site,
// the page designed for MSIE and other JS browsers


*) Forms are enumerated in an array "forms", which is also a property of
"document" object.

Example of server-side browser-detection:

<form action="..." method="..." name="detector">
<input name="browser" value="Not capable of JS" type=hidden>
<input type=submit value="Detect your browser!">
</form>
<script language="JavaScript">
<!--
// JavaScripts may be commented out, e.g. for Arachne 1.0,
// so "<!--" in JS is always ignored.

// The following JS code is not part of any function defined,
// it will be executed immediately instead!

document.forms[0].browser.value="Capable of JS";
document.forms[0].elements['browser'].value="Capable of JS";
document.forms[0].elements[0].value="Capable of JS";
document.forms['detector'].browser.value="Capable of JS";
document.forms['detector'].elements['browser'].value="Capable of JS";
document.forms['detector'].elements[0].value="Capable of JS";

// All the above properties are valid; 0 is the index for our form
// in document, or for "browser" element in form. For example,

document.forms['detector'].elements[1].value="Capable of JS";

// will change text on the submit button instead ;-)
// and Arachne should really redraw the button, 
// if its JS implementation will develop further ;-))
// ... even Netscape 3 DOES redraw the button, 
// though it does not resize it.


//--></script>




Where and how the values of form elements are actually stored 
in Arachne? If I knew it I could write a C++ code myself. As I've already
mentioned in my list of Arachne unsupported features, HTML objects tend to be
organised hierarchically anyway, even where they are actually stored (memory of
browser).

How HTML tags are parsed in Arachne and how their attributes are read?
Implementing JavaScript means you are to avoid <SCRIPT language="VBScript">,
which is Microsoft Visual BASIC. And, text between <SCRIPT> and </SCRIPT> also
_REQUIRES_ a JS interpreter instead of standard, because it may contain any
HTML tags (even </SCRIPT>) inside of JS string constants.

I'll provide you with DOM required for masquerade (MSIE-like JS engine
behaviour). I also insist on implementing some basic JS functions (e.g. DOM for
Arachne titlebar and status line).

Anyway, sooner or later we'll need an interpreter for operators like
document.location = "http://"; + "arachne" + ".cz/";

I subscribed myself to arachne-development a week ago. You may prefer talking
there, if I was not automatically unsubsribed for some reason ;-) The last I've
heard from that was Michael Polak confessed that he has a full-time Internet
connectivity which consumes all his spare time... no time for Arachne
development ;-)))


Deeply yours,

 M   M
 MM MM
 M M M  I  T  H  G  O  L
 M   M                            http://mithgol.pp.ru/
            T  H  E                  [EMAIL PROTECTED]
W     W
W  W  W   E  B  M  A  S  T  E  R
 W W W
  W W

Reply via email to