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


Groups > comp.lang.javascript > #39272

Re: Debug ipad

From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: Debug ipad
Date 2020-12-15 04:20 +0100
Organization PointedEars Software (PES)
Message-ID <3568762.kQq0lBPeGt@PointedEars.de> (permalink)
References <xMednVkmwbpTaUrCnZ2dnUU7-Y3NnZ2d@westnet.com.au> <XnsAC9474388E69eejj99@194.109.6.166> <D_KdnZq62_zMmUXCnZ2dnUU7-Y3NnZ2d@westnet.com.au>

Show all headers | View raw


Andrew Poulos wrote:

> On 15/12/2020 10:42 am, Evertjan. wrote:
>> Andrew Poulos <ap_prog@hotmail.com> wrote on 15 Dec 2020 in
>> comp.lang.javascript:
>>> I don't own a Mac and I've been shown bugs, in a website we built, that
>>> only seem to happen on an ipad. I been given possession of the ipad and
>>> can reproduce the errors but I don't know how to debug them.
>> Wouldn't that be browser-dependent, rather than device or o.s. dependent?
> 
> Yes, that's what I was expecting but there are bugs that only happen
> when the site is viewed on an ipad.

"ipad" is not a browser.  Find out with which browser the problem occurs, 
then you can be advised better.

>>> I added some code that will alert when an JavaScript error is triggered
>>> but on the ipad it fails silently.
>> 
>> What does that mean 'an JavaScript error is triggered'?
>> 
>> Can you write code for that? I doubt that, please show relevant code.
> 
> I use this to display errors:
> 
> window.onerror = function (msg, url, lineNo, columnNo, error) {
>    let message = [
>        'Message: ' + msg,
>        'URL: ' + url,
>        'Line: ' + lineNo,
>        'Column: ' + columnNo,
>        'Error object: ' + JSON.stringify(error)
>      ].join(' - ');
> 
>    window.alert(message);
> };

If window.error works in that case, probably window.alert(…) is disabled in 
the “error” event listener as it is not triggered by a user interaction.
In that case you can instead

- send the error message to your server via XHR/Fetch;
- append the error message to the Web site
  · for users to copy it
  · for users to send it to you in an e-mail; use something like
 
      window.location = 'mailto:your.email@address.example'
        + ?subject=error'
        + '&body=' + encodeURIComponent(errorMessage);

    in the event listener of a widget that you generate then.

Otherwise you could wrap your entire code in

  try
  {
    /* … */
  }
  catch (e)
  {
    /* or similar */
    window.alert('…')
  }

but probably only for debugging purposes (you could give the user a debug 
link with a token that must match for this to happen, so as to not 
compromise your app or your server).

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
<https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | 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


Thread

Debug ipad Andrew Poulos <ap_prog@hotmail.com> - 2020-12-15 10:27 +1100
  Re: Debug ipad "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-12-15 00:42 +0100
    Re: Debug ipad Andrew Poulos <ap_prog@hotmail.com> - 2020-12-15 11:33 +1100
      Re: Debug ipad Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-12-15 04:20 +0100
        Re: Debug ipad Andrew Poulos <ap_prog@hotmail.com> - 2020-12-15 14:56 +1100
          Re: Debug ipad Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-12-15 13:29 +0100
            Re: Debug ipad Andrew Poulos <ap_prog@hotmail.com> - 2020-12-16 10:45 +1100
              Re: Debug ipad Andrew Poulos <ap_prog@hotmail.com> - 2020-12-16 11:14 +1100
  Re: Debug ipad Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-12-15 03:48 +0100
  Re: Debug ipad Arno Welzel <usenet@arnowelzel.de> - 2020-12-19 13:09 +0100

csiph-web