Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #31283
| Newsgroups | comp.lang.javascript |
|---|---|
| Date | 2016-09-09 06:20 -0700 |
| References | <toydnbeQVIupLk3KnZ2dnUU7-KXNnZ2d@westnet.com.au> <18kx87e56fmrr.u0ghv1tkc6cu.dlg@40tude.net> <92e03e5f-e115-40d1-ba94-4b34459d8c14@googlegroups.com> <nqrspj$dg4$1@news.albasani.net> <cpCdnY3Cg6HZok_KnZ2dnUU7-YnNnZ2d@westnet.com.au> |
| Message-ID | <84944e2b-071c-4725-9b7e-7fac6072e40a@googlegroups.com> (permalink) |
| Subject | Re: restore window alert |
| From | "Michael Haufe (TNO)" <tno@thenewobjective.com> |
On Thursday, September 8, 2016 at 11:49:20 PM UTC-5, Andrew Poulos wrote:
> On 9/09/2016 12:32 AM, Martin Honnen wrote:
> > On 08.09.2016 15:43, Michael Haufe (TNO) wrote:
> >> On Thursday, September 8, 2016 at 6:47:29 AM UTC-5, JJ wrote:
> >>> On Thu, 8 Sep 2016 10:39:16 +1000, Andrew Poulos wrote:
> >
> >>>> Is there any way to reference the native window.alert once its been
> >>>> overridden?
> >
> >>> Use:
> >>>
> >>> window.constructor.prototype.alert
> >>>
> >>> e.g.:
> >>>
> >>> window.constructor.prototype.alert.call(window, "the message");
> >>>
> >>> or restore it as a different name for easy access later e.g.:
> >>>
> >>> window.alert2 = window.constructor.prototype.alert;
> >>> window.alert2("the message");
> >>
> >>
> >> I like this solution better than mine, but I'm paranoid about using
> >> "window.constructor". I see it in my mind as:
> >> [host object].constructor
> >>
> >> Is this "safe" to us like this?
> >
> > For me on Windows 10 the alert only appears with Internet Explorer in
> > https://jsfiddle.net/apawxx0m/, Edge, Chrome and Firefox show a script
> > error in the console .
>
> In Chrome I get
> Uncaught TypeError: Cannot read property 'call' of undefined
>
> In Firefox I get
> TypeError: window.constructor.prototype.alert is undefined
>
> In Edge I get
> Unable to get property 'call' of undefined or null reference
>
> :-(
Back to the iframe I'd say...
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
restore window alert Andrew Poulos <ap_prog@hotmail.com> - 2016-09-08 10:39 +1000
Re: restore window alert "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-09-07 18:00 -0700
Re: restore window alert JJ <jj4public@vfemail.net> - 2016-09-08 18:47 +0700
Re: restore window alert "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-09-08 06:43 -0700
Re: restore window alert Martin Honnen <martin.honnen@gmx.de> - 2016-09-08 16:32 +0200
Re: restore window alert Andrew Poulos <ap_prog@hotmail.com> - 2016-09-09 14:49 +1000
Re: restore window alert "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-09-09 06:20 -0700
Re: restore window alert Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-09-10 16:26 +0200
Re: restore window alert Ram Tobolski <ramtob@gmail.com> - 2016-09-11 00:17 -0700
Re: restore window alert Andrew Poulos <ap_prog@hotmail.com> - 2016-09-11 17:57 +1000
Re: restore window alert Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-09-11 11:19 +0200
Re: restore window alert Andrew Poulos <ap_prog@hotmail.com> - 2016-09-11 19:00 +1000
Re: restore window alert Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-09-11 13:24 +0200
csiph-web