Discourse not loading on legacy browsers

What about this @david

if (!String.prototype.replaceAll) {
	String.prototype.replaceAll = function(str, newStr){

		// If a regex pattern
		if (Object.prototype.toString.call(str).toLowerCase() === '[object regexp]') {
			return this.replace(str, newStr);
		}

		// If a string
		return this.split(str).join(newStr);

	};
}

I changed the string branch of the solution you shared, so it fixes converting Strings to Regex without escaping.

4 Likes

I don’t think that will work when a function is passed as the second argument:

"my string with my example".replaceAll("my", (match) => `test${match}`)

(docs on the function can be found here)

5 Likes

I am using an iPad Air with iOS version 12.5.5. The latest version of Chrome browser available for this tablet won’t load Sketchup forum. I get the same banner message mentioned in several of the previous posts. Is there any way to fix this issue other than upgrading to a new iPad?

Sounds good to me :+1:

I think this should do it:

6 Likes

Hmmm, while this fixes using Discourse on MacOS Mojave, it appears that iOS 12.5.5 also fail our globalThis check.

Do we want to polyfill that too?

4 Likes

Yea! The site (both Discourse and Community.Jenkins.io) seem to be working OK again on the legacy browsers; I can see contents and can post (on Jenkins and here).

Most appreciated all the effort it took to resolve this; seemed much more involved than I expected.

Now, if I can only convince StackOverflow to revert their breaking changes (for a 2nd time) and restore functionality for legacy browsers. They did it once but their new attitude seems to be blame the user.

4 Likes

Yes, this forum is working again on iOS 12.2, though https://support.last.fm/ still isn’t (maybe they need to update something?)
Again thank you for your time fixing it

Keep in mind, our biggest focus is on not breaking old browsers. A blank page is simply not acceptable, not even on ancient browsers. A readonly view is acceptable.

The tricky thing that happened here is that we have some browsers that are in a twilight state, not exactly supported and not exactly not supported, sadly they got a white page treatment.

We are thinking of better approaches going forward to avoid regularly hitting these issues as our minimal browser version number creeps up.

7 Likes

Just to clarify, some of our users on https://support.last.fm/ are still reporting problems: Mobile view of this forum is broken - #6 by tutibins - Get Help - Last.fm Support Community

Has this fix been deployed to hosted sites yet?

If so, that would suggest a theme/component we’re using or our custom css is breaking it, but I don’t want to fiddle with that stuff if the fix hasn’t deployed yet. :slight_smile:

Thanks again for looking into this.

1 Like

Hi Jon - this change hasn’t been deployed out to all our hosted sites yet. But I’ll get that process started now - it should hit your site in the next hour or so.

3 Likes

It is now working!
Thank you!

1 Like

Brilliant, thanks David. :+1:

3 Likes

When will the change be deployed to forums.sketchup.com?

Deploying right now! :slight_smile:

5 Likes

I am reopening cause some people are still having issues.

The plan:

  1. remove, browser_update_user_agents we don’t want to feature detect with that anymore.
  2. Add optimise_traffic_on_modern_mobile_browsers (default true) - if users have a supported mobile user browser (modern chrome / safari) we will optimise transport by avoiding shipping the HTML payload.
  3. Some basic design work on crawler / html view - (improve styling / padding / margins) and so on by @Designers

@Falco how does this sound?

I will see if I can get to this next week, if not will get it assigned internally the week after.

6 Likes

Sounds :+1:

Be careful when testing on Meta, the tableless design experiment here regressed our crawler view quite a bit.

People on early iOS 12 still fail to boot the app because they lack window.globalThis. You can easily repro that on Browserstack. We need to ship the HTML no-script content for those folks. Your plan step 1 will solve that.

5 Likes

I made a minor PR to make these views more readable:

10 Likes

Looks amazing, I also left a comment on a PR. Google does mobile first indexing, so we have to test a mobile resolution carefully, cause that is the general consumer of this view.

5 Likes