Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #31070
| Path | csiph.com!news.mixmin.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail |
|---|---|
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Newsgroups | comp.lang.javascript |
| Subject | Re: Is it possible to do AJAX coding on the *same* computer? |
| Date | Fri, 05 Aug 2016 07:37:45 +0200 |
| Organization | PointedEars Software (PES) |
| Lines | 111 |
| Message-ID | <11607840.uLZWGnKmhe@PointedEars.de> (permalink) |
| References | <29ee462f-7cc5-4c7a-b9a2-ef1bbcbe371f@googlegroups.com> <fe1ee599-9136-4991-a798-94ac233e713c@googlegroups.com> <ud-dnaSNvtSyOTzKnZ2dnUU7-dednZ2d@westnet.com.au> <437972ee-7b0a-4c65-ab7b-3dc8f120177d@googlegroups.com> <084c6ab6-6a3c-4978-86a7-25c45bb566d1@googlegroups.com> <5c98583c-a491-459c-a1b6-a63148ab10e2@googlegroups.com> <9b574432-59c9-4627-80c6-510cd6328118@googlegroups.com> <1778487.oMNUckLgyt@PointedEars.de> <399e366a-a49e-4211-9d39-5d533fd6d9b6@googlegroups.com> <4219161.GXAFRqVoOG@PointedEars.de> <9312865b-68d7-495c-8305-0a08b9b2a91d@googlegroups.com> |
| Reply-To | Thomas 'PointedEars' Lahn <cljs@PointedEars.de> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset="UTF-8" |
| Content-Transfer-Encoding | 8Bit |
| X-Trace | solani.org 1470375467 24179 eJwFwQkBwDAIA0BL40lK5QAF/xJ2B6OwjxN0LDaDniGJuWe+2mrFBEgxV3iVz6jxdfJ24/0eLBFk (5 Aug 2016 05:37:47 GMT) |
| X-Complaints-To | abuse@news.solani.org |
| NNTP-Posting-Date | Fri, 5 Aug 2016 05:37:47 +0000 (UTC) |
| User-Agent | KNode/4.14.2 |
| X-User-ID | eJwNysEBgEAIA7CVsEBPxwEs+4+geSedF+cEk5GbG1UauWE61Mqn94cH8ML8p2X0MGLvsnfQLlFYK+TqfILZFps= |
| Cancel-Lock | sha1:ixIzRGLMtsvI1gFutJcqB/EPuLA= |
| X-NNTP-Posting-Host | eJwFwYEBACAEBMCVlOc1TsL+I3Rn6ssf4eawsUHWUJK5rQOaLaJF3GHw3K3dMQ/NqhCd5R8mNxFs |
| Xref | csiph.com comp.lang.javascript:31070 |
Show key headers only | View raw
Michael Haufe (TNO) wrote:
> Thomas 'PointedEars' Lahn wrote:
>> Michael Haufe (TNO) wrote:
>> > Given there is no information from the OP, I don't even want to assume
>> > he's even trying to request something from the same domain
>> A distinct possibility. But then your suggestion makes even less sense
>> to me.
>
> If there was a standalone html file opened directly from the filesystem,
> that wouldn't be 'localhost', yet it could attempt to make a request to a
> local server with a proper http(s) url. That's what I was referring to
ACK. If CORS is supported by the client, then it is possible to make
requests this way if the server sends
Access-Control-Allow-Origin: *
or
Access-Control-Allow-Origin: null
[The latter variant, which corresponds to the CORS specification [1], works
in Chromium “51.0.2704.79 Built on 8.4, running on Debian stretch/sid (64-
bit)” and Iceweasel 38.1.0. However, by contrast to the former, CORS would
then only work from non-HTTP sites like file://… to the HTTP site.]
Stefan Ram has described correctly how to do this with Apache in general.
But the OP has said that they have installed LAMP (Linux Apache MySQL PHP)
on their machine. I agree that the OP is a bit vague, but it appears a
stretch to me to assume that they are meaning requests from “file://”.
>> > Is there a free alternative [to buggy, trolled, spammed Google Groups]
>> > that doesn't require me to download a new client across a handful of
>> > machines?
>
> Nice substitution... so very true
I have read a funny remark to the GG situation yesterday, which I found so
apt that I added it to my sig file:
“[…] instead of firing any incompetent programmers they may accidentally
hire, they send them to a dungeon deep below their main building, where
they work on making Google Groups worse.”
–Michael Moroney in <news:nnu48k$c7o$1@pcls7.std.com>
>> I am also working on one: a Web application based on KNode (which is not
>> supported by KDE anymore).
>
> I'd look forward to seeing it.
As I am to writing it. Thanks.
> I vaguely recall that one of the group members was working on a
> GreaseMonkey script that would make the GG interface bearable. That may
> be something worth revisiting. I'd dig through the archives to find it,
> but the GG interface has changed significantly since it was written.
The markup did not change that much, so I was able to tweak my original
script (which I am not sure I published here) inasfar as that the initial
thread view is modified (threads recognized as spam by the word filter can
be marked as such, a [user] stylesheet can then hide them). While doing
that I (re)discovered that pattern for when the “load” event is
insufficient:
/* or with window.setTimeout(…) and .clearTimeout(…) */
var interval = window.setInterval(function () {
var keyElement = document.getElement…(…);
if (!keyElement || !keyElement.length) return;
window.clearInterval(interval);
/* Do things if keyElement is there/non-empty */
}, pollingInterval);
This pattern is so common that it could be generalized into a method –
jsx.waitFor(conditionCallback, pollingInterval, actionCallback);
so that you could write instead
var keyElement;
jsx.waitFor(
() => {
keyElement = document.getElement…(…);
return (!keyElement || !keyElement.length);
},
pollingInterval,
() => {
/* Do things if keyElement is there/non-empty */
});
The main problem is that Google Groups is loading threads asynchronously now
(plus continuous scrolling), and there are no events that I can see that I
could add a listener for (is there a Google Groups API?); so the marking
procedure would have to be adapted for continuous polling [sic], too, before
the script is usable.
As I indicated, I would rather spend the time on writing something
considerably better than Google Groups, something with which one is also not
dependent on a single Web site. But maybe further tweaks would help me in
both development directions (continuous scrolling is an intriguing concept
for a newsreader, particularly a Web-based one).
--
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not cc me. / Bitte keine Kopien per E-Mail.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Is it possible to do AJAX coding on the *same* computer? bit-naughty@hotmail.com - 2016-08-02 09:49 -0700
Re: Is it possible to do AJAX coding on the *same* computer? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-08-02 22:26 -0700
Re: Is it possible to do AJAX coding on the *same* computer? bit-naughty@hotmail.com - 2016-08-02 23:48 -0700
Re: Is it possible to do AJAX coding on the *same* computer? Andrew Poulos <ap_prog@hotmail.com> - 2016-08-03 17:58 +1000
Re: Is it possible to do AJAX coding on the *same* computer? I Am Here <iamhereintheworld@gmail.com> - 2016-08-03 13:16 -0700
Re: Is it possible to do AJAX coding on the *same* computer? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-08-03 16:13 -0700
Re: Is it possible to do AJAX coding on the *same* computer? bit-naughty@hotmail.com - 2016-08-04 06:56 -0700
Re: Is it possible to do AJAX coding on the *same* computer? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-08-04 09:37 -0700
Re: Is it possible to do AJAX coding on the *same* computer? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-08-04 19:22 +0200
Re: Is it possible to do AJAX coding on the *same* computer? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-08-04 10:57 -0700
Re: Is it possible to do AJAX coding on the *same* computer? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-08-04 20:20 +0200
Re: Is it possible to do AJAX coding on the *same* computer? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-08-04 13:22 -0700
Re: Is it possible to do AJAX coding on the *same* computer? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-08-05 07:37 +0200
User scripts (was: Is it possible to do AJAX coding on the *same* computer?) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-08-06 13:38 +0200
Re: Is it possible to do AJAX coding on the *same* computer? bit-naughty@hotmail.com - 2016-08-05 12:44 -0700
Re: Is it possible to do AJAX coding on the *same* computer? Tim Streater <timstreater@greenbee.net> - 2016-08-06 20:08 +0100
Re: Is it possible to do AJAX coding on the *same* computer? Tim Streater <timstreater@greenbee.net> - 2016-08-06 20:00 +0100
Re: Is it possible to do AJAX coding on the *same* computer? bit-naughty@hotmail.com - 2016-08-08 04:18 -0700
Re: Is it possible to do AJAX coding on the *same* computer? Tim Streater <timstreater@greenbee.net> - 2016-08-08 12:23 +0100
csiph-web