Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #39267 > unrolled thread
| Started by | Andrew Poulos <ap_prog@hotmail.com> |
|---|---|
| First post | 2020-12-15 10:27 +1100 |
| Last post | 2020-12-19 13:09 +0100 |
| Articles | 10 — 4 participants |
Back to article view | Back to comp.lang.javascript
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
| From | Andrew Poulos <ap_prog@hotmail.com> |
|---|---|
| Date | 2020-12-15 10:27 +1100 |
| Subject | Debug ipad |
| Message-ID | <xMednVkmwbpTaUrCnZ2dnUU7-Y3NnZ2d@westnet.com.au> |
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. I added some code that will alert when an JavaScript error is triggered but on the ipad it fails silently. On a desktop I can press the F12 key and bring up the developer console... but fFor an ipad is my only option getting a Mac? Andrew Poulos
[toc] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2020-12-15 00:42 +0100 |
| Message-ID | <XnsAC9474388E69eejj99@194.109.6.166> |
| In reply to | #39267 |
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? > 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. > On a desktop I can press the F12 key and bring up the developer > console... but fFor an ipad is my only option getting a Mac? -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Andrew Poulos <ap_prog@hotmail.com> |
|---|---|
| Date | 2020-12-15 11:33 +1100 |
| Message-ID | <D_KdnZq62_zMmUXCnZ2dnUU7-Y3NnZ2d@westnet.com.au> |
| In reply to | #39268 |
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. I don't have an iphone to test on
but on my Android phone the site displays as expected.
The website is an elearning course with "lots of interactivity".
>> 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);
};
Andrew Poulos
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2020-12-15 04:20 +0100 |
| Message-ID | <3568762.kQq0lBPeGt@PointedEars.de> |
| In reply to | #39269 |
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.
[toc] | [prev] | [next] | [standalone]
| From | Andrew Poulos <ap_prog@hotmail.com> |
|---|---|
| Date | 2020-12-15 14:56 +1100 |
| Message-ID | <RrednVAqGoWWqUXCnZ2dnUU7-IfNnZ2d@westnet.com.au> |
| In reply to | #39272 |
On 15/12/2020 2:20 pm, Thomas 'PointedEars' Lahn wrote:
> 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.
The bugs appear in the ipad's default Safari browser and in Chrome.
>>>> 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
Dang, I forgot that that can happen.
> - send the error message to your server via XHR/Fetch;
It's not for users so I'll send it to the server.
> - 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).
Andrew Poulos
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2020-12-15 13:29 +0100 |
| Message-ID | <3339519.iIbC2pHGDl@PointedEars.de> |
| In reply to | #39273 |
Andrew Poulos wrote: > On 15/12/2020 2:20 pm, Thomas 'PointedEars' Lahn wrote: >> 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. > > The bugs appear in the ipad's default Safari browser and in Chrome. _iPad_ There is also (Web sites like) BrowserStack with which you can test on virtual devices: <https://www.browserstack.com/> -- 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.
[toc] | [prev] | [next] | [standalone]
| From | Andrew Poulos <ap_prog@hotmail.com> |
|---|---|
| Date | 2020-12-16 10:45 +1100 |
| Message-ID | <092dnaqTUN0o10TCnZ2dnUU7-dXNnZ2d@westnet.com.au> |
| In reply to | #39274 |
On 15/12/2020 11:29 pm, Thomas 'PointedEars' Lahn wrote:
> Andrew Poulos wrote:
>
>> On 15/12/2020 2:20 pm, Thomas 'PointedEars' Lahn wrote:
>>> 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.
>>
>> The bugs appear in the ipad's default Safari browser and in Chrome.
By putting in alerts at various places I found one place where the code
stop running. At that spot I found (the incorrect):
document.querySelectorAll('[name="efontfam"')
which desktop Chrome accepts but iOS Safari does not.
> _iPad_
>
> There is also (Web sites like) BrowserStack with which you can test on
> virtual devices:
>
> <https://www.browserstack.com/>
Hmm, the free plan gives me about a minute, and at AUD $60 per month (or
AUD $20 for 100 minutes in a month) it's probably worth it to buy a
second-hand ipad.
Andrew Poulos
[toc] | [prev] | [next] | [standalone]
| From | Andrew Poulos <ap_prog@hotmail.com> |
|---|---|
| Date | 2020-12-16 11:14 +1100 |
| Message-ID | <uZmdnULl0vvQzETCnZ2dnUU7-eudnZ2d@westnet.com.au> |
| In reply to | #39275 |
On 16/12/2020 10:45 am, Andrew Poulos wrote: > Hmm, the free plan gives me about a minute, and at AUD $60 per month (or > AUD $20 for 100 minutes in a month) it's probably worth it to buy a > second-hand ipad. I meant second-hand Mac.
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2020-12-15 03:48 +0100 |
| Message-ID | <20886445.EfDdHjke4D@PointedEars.de> |
| In reply to | #39267 |
Andrew Poulos wrote: > 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. > > I added some code that will alert when an JavaScript error is triggered > but on the ipad it fails silently. > > On a desktop I can press the F12 key and bring up the developer > console... but fFor an ipad is my only option getting a Mac? Maybe not. For Android: <https://developers.google.com/web/tools/chrome-devtools/remote-debugging> Maybe there is a similar option in iOS so that you can debug Chrome on iOS. You can USB-debug Mobile Safari, but I think you need Desktop Safari to do that. You can try running an older version of Safari for Windows via Wine on GNU+Linux, or you can install macOS in a VM. -- 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.
[toc] | [prev] | [next] | [standalone]
| From | Arno Welzel <usenet@arnowelzel.de> |
|---|---|
| Date | 2020-12-19 13:09 +0100 |
| Message-ID | <i468rcF9cn0U1@mid.individual.net> |
| In reply to | #39267 |
Andrew Poulos: > 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. > > I added some code that will alert when an JavaScript error is triggered > but on the ipad it fails silently. > > On a desktop I can press the F12 key and bring up the developer > console... but fFor an ipad is my only option getting a Mac? <https://blog.idrsolutions.com/2015/02/remote-debugging-ios-safari-on-os-x-windows-and-linux/> <https://appletoolbox.com/use-web-inspector-debug-mobile-safari/> HTH -- Arno Welzel https://arnowelzel.de
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.javascript
csiph-web