edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev] master window
@ 2018-01-31  1:16 Karl Dahlke
  2018-01-31  1:40 ` Kevin Carhart
  0 siblings, 1 reply; 3+ messages in thread
From: Karl Dahlke @ 2018-01-31  1:16 UTC (permalink / raw)
  To: Edbrowse-dev

[-- Attachment #1: Type: text/plain, Size: 1496 bytes --]

It wasn't a rewrite, but certainly a reorganize.
Most of startwindow.js now lives in the "master window" block, wherein it is compiled only once.
This saves space and time, and allows for a proper instanceof operator, as described in my previous post.
Here's a tricky thing about the reorganization though.
On rare occasions a function refers to document.
If compiled once, it always refers to document in window 0. That's bad!
I wrote a my$doc function in the master window to figure out the document of your current context.
The compiled-once function can use that to refer to document.
I tried function() { return eval("document"); }, which I thought would run in realtime and work, but it doesn't work. Don't know why.
Maybe eval runs once when the function is compiled.
In any case, I had to write it as a native method, which isn't hard, it's only 3 lines of C.
This function is critical; it's key to folding all that stuff into the master window.

I also made a few minor fixes here and there, and uncovered something else that I didn't fix,
because I don't know anything about it, never heard of it, and it logically belongs in another commit.
It did however cause a seg fault, and I had to work around that.
See startwindow.js line 1421.
Here it is, from oranges.com.

document.createElement("g:plusone");
document.createElement('<iframe name="stlframe" allowtransparency="true" style="body{background:transparent;}" ></iframe>');

What are those?!

Karl Dahlke

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Edbrowse-dev] master window
  2018-01-31  1:16 [Edbrowse-dev] master window Karl Dahlke
@ 2018-01-31  1:40 ` Kevin Carhart
  2018-01-31  2:18   ` Karl Dahlke
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Carhart @ 2018-01-31  1:40 UTC (permalink / raw)
  To: Edbrowse-dev




>
> document.createElement("g:plusone");

Maybe this is how site developers put a Google Plus button on their page 
that the visitor would click to "like" it, etc.

I never saw those before, but maybe the site has a library that mucks 
around with createElement to allow additional element types and that 
inline iframe syntax?

These things crashed edbrowse?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Edbrowse-dev] master window
  2018-01-31  1:40 ` Kevin Carhart
@ 2018-01-31  2:18   ` Karl Dahlke
  0 siblings, 0 replies; 3+ messages in thread
From: Karl Dahlke @ 2018-01-31  2:18 UTC (permalink / raw)
  To: Edbrowse-dev

[-- Attachment #1: Type: text/plain, Size: 1154 bytes --]

> maybe the site has a library that mucks around with createElement

A really good guess. I hadn't thought of that.
Snag the old function, put yours in its place, and call the old one on traditional arguments.
So I gathered all the javascript from oranges.com, deminimized, and grepped for createElement.
document.createElement is never assigned anything. The site does not overload it.
It is, I assume, the base browser function.
We could test this by writing a little script and letting other browsers process it. What do they do?
Here are the unusual calls from oranges.com.

'<a></a>'
'<div class=\'' + j + '\' data-action=\'' + e + '\' data-send=\'false\' data-layout=\'' + g + '\' data-show-faces=\'false\' data-href=\'' + c + '\'></div>'
'<div class=\'' + j + '\' data-href=\'' + c + '\'></div>'
'<div></div>'
'<iframe name="' + e + '" ></iframe>'
'<iframe name="stLframe" allowTransparency="true" style="body{background:transparent;}" ></iframe>'
'<iframe name="stframe" allowTransparency="true" scrolling="no" frameBorder="0"></iframe>'
'<iframe></iframe>'
'<img></img>'
'<span></span>'
'g:plus'
'g:plusone'

Karl Dahlke

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-31  2:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-31  1:16 [Edbrowse-dev] master window Karl Dahlke
2018-01-31  1:40 ` Kevin Carhart
2018-01-31  2:18   ` Karl Dahlke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).