-
-
Notifications
You must be signed in to change notification settings - Fork 927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
m.trust carsh in safari - ios 16.3 #2820
Comments
maybe because m.trust include marilto link like this:
|
Could you share examples of the HTML source that crashes Safari? Short of leaking memory from JS, a page shouldn't crash a browser, so it's likely a Safari bug. It would be nice to see what markup causes it though (what tags, does it contain CSS, etc...). |
this is the page I connected my iphone to the mac, But it is looks hard to read I wanted to prepare a minimal version that only included the mithril component where the problem was, the page works! but at crashed page, when I remove the m.trust(...),the page works Too strange I'll review and check the code again maybe some other reasons
|
So you're passing a full HTML page to Wouldn't you be better served by an |
ohh,no no 😂
the HTML-page is the content from safari -> look source code i found some other situations: I checked the code carefully and found that the problem is more complicated than I expected
In the callback function of these listeners, the m.redraw() function is used to control some changes of the page by modifying the state of some variables The above two occur at the same time, and the click event running on the safari page will not work normally. Sorry my previous description wasn't precise enough But this situation has not been reproduced under pc chrome, pc Firefox or mac safari, including the mobile development mode of pc chrome, and the chrome of Android phone. If I use str.replace to remove the mailto tag, or I close the listener of [Pull-down Refresh], if one of them is satisfied, the problem of safari’s unresponsive touch will disappear |
What I'd like to see is the exact input that goes into |
console.log(node = m.trust(marked(content)))
console.log(node.children)
console.log(content)
console.log(marked(content))
|
I use this as temporary solution:
|
Thanks, this looks completely inoccuous... I don't think Mithril or the HTML is at fault here. At least not the bits you shared. It could cause the planets to align just wrong and trigger a different bug though. Does desktop safari crash too? If so, could you share the relevant output of the |
Yeah, it only crashed in my ios safari -- and recently I update my iphone and ipad to ios 16.3. so i'm not certain it happend in other ios version. But in my Mac's safari, it can runs good. so i hightly doubt that it is a safari's bug. Because I visit my website everyday, and before my update, I never found the situation. Tough I also update my program recently. But the changed code does not involve these modules. I link my iphone to my macbook and use devTools check it due to some javascript Error at console, but nothing. I change to the performance tag, check for high cpu or memory usage, but the line is flat. Because the iphone debugging page is very troublesome, I tried to split the code to single page see if it can be reproduced, but failed, I will continue to follow up and observe this situation |
AFAIK, short of a bug, the only way to crash a browser tab is to exhaust memory. I don't think that Does the |
Oh, you may have missed my supplementary instructions. I mentioned that when the two points happen at the same time, it will cause a crash. Using m.trust alone or using touch events will not happen |
Indeed I had skipped that bit of your post, sorry. What if you add a Edit: you can encode the email like this: function htmlEncode(src) {
return [...src].map(c => `&#${
Math.random() < 0.5 ? c.codePointAt(0).toString() : "x" + c.codePointAt(0).toString(16)
};`).join("")
}
|
I record a video : videoLink |
I try to upload to the google drive,but the speed is too slow.... |
I can see the video, I'll watch it later today. |
when I log out i find it can only play one minutes, emmm let us wait google drive... |
here is the google drive:link |
Hey man, were you able to fix the issue at hand? @0ui0 |
Also something completely besides the point. Is there any specific reason for client-side rendering your fairly complex looking data intensive platform that you're building right now? Reason for asking is because of the slow load-times and I can imagine that this matter would improve a lot when server-rendering the UI and only loading the actual content on the client side from js. Apart from that bit. The side you're building looks great, props to ya man! (even though I can't read any of it without google translate) |
Yeah, thanks for your advice and appreciation now I only replace the @ sign as the video doing Maybe I will spend more special time pay attention to this. --- about client-side rendering --- --- about language --- |
hey, i find this will lead to same problem today, also at ios safari: so strange |
Just to verify: does this cause a crash? `<a href=mailto:${htmlEncode("[email protected]")}>${htmlEncode("[email protected]")}</a>` If not, does this? var elem = document.createFragment("div")
elem.insertAdjacentHTML("afterbegin", `<a href=mailto:${htmlEncode("[email protected]")}>${htmlEncode("[email protected]")}</a>`) If that doesn't either, does this? var elem = document.createFragment("div")
elem.innerHTML = `<a href=mailto:${htmlEncode("[email protected]")}>${htmlEncode("[email protected]")}</a>` |
Oh, and can you make a full code sample of something that crashes on https://flems.io, https://codepen.io, or similar? I'm typing this from an iPhone, so I definitely have a device to test it on. 🙂 |
I find the key problem! look at the example, the button can't click: |
This link is not crashing for me, unfortunately. I am seeing no click event, though, but I suspect that's actually a browser bug. |
I don't see a triggered click on safari (iOS 17.1) either. |
Mithril.js version: 2.2.2
Browser and OS: ios16.3 safari
Project: icat
The page is working normal in PC chrome, MAC sarari-16.3 (18614.4.6.1.5),Android chrome(unkown version)
But it carshed in iphone safari-ios16.3
When loading this page, all touch actions will be slow, and after that, the page cahshed.
I debug and find it happend when I use m.trust() to parse the HTML from marked.js
crashed code:
or
but not all page crashed,
only the page,
i review the page's markdown, it use normal grammer no special --- no extend HTML.
because it working nomal in other browser
I don't know it is whether or safari's bug
or marked.js bug or mithril.js bug
The text was updated successfully, but these errors were encountered: