Closed route999 closed 4 years ago
Reported again by Markus by email today.
@route999 thank you for reporting this issue. I was able to reproduce it using Chrome's dev tools. Instead of using setInterval
, I've made it so that the preview snippet code runs after the window is fully loaded (instead of after the DOM is loaded). I believe this should resolve the issue you've been experiencing.
You can try this out for yourself by downloading our beta version here - https://github.com/semperfiwebdesign/all-in-one-seo-pack/tree/fe0cbaf073293a784f0c7ecf1f8d1f2b1e11feb3. I'd appreciate it if you could check it out since I can only simulate a slow computer/connection on my end.
Hi, @arnaudbroes window load won't fix the issue in this case because the elements you are targeting are not in that window load, they are in a separate load time because they are in an iframe that loads separately from the actual window. So no, it still has the same error from before.
@route999 thank you for getting back to me. I appreciate it.
I've added an explicit check to make sure that the iframe is loaded. Can you check and see if you now still run into any issues? The commit can be found above this comment.
@arnaudbroes yep, the error is gone now. Thanks!
@route999 awesome, thank you so much for your help on this one! Pushing this to testing now. We'll make sure to include it in our next bug fix release.
@arnaudbroes np, when do you think that the next release is going to be available? I have 150 websites that mostly use IE11 to edit their sites and all of them use the pro version. The clients are getting anxious about the issue.
@route999 we expect it to be out this week.
Hi,
I have an issue on multiple sites while using your pro version of the plugin.
All In One SEO Pack Pro - Version 3.3.4 WordPress - Version 5.3.1 Classic Editor - Version 1.5
aioseop-admin-functions.js?ver=3.3.4:88 Uncaught TypeError: Cannot read property 'innerHTML' of undefined at aioseopGetClassicEditorContent (aioseop-admin-functions.js?ver=3.3.4:88) at aioseopUpdatePreviewSnippet (aioseop-preview-snippet.js?ver=3.3.4:91) at aioseop-preview-snippet.js?ver=3.3.4:68
To my understanding, the issue is happening because in your code in this file aioseop-preview-snippet.js you have a setTimeout expecting the iframe #content_ifr to load in 1 second, however on browsers like IE11 or people that have slower internet connection or slower sites or loading backends that one second is going to fire too early and it will throw that error you see above, simply because the elements you are looking for in this part of the code
jQuery('#content_ifr').contents().find('body')[0].innerHTML;
are not existing.A much better way to implement this is to use interval that will check if the elements you are looking for are defined or not. Here is my quick fix. I know it's not elegant but this is not my code and I don't have time to deal with how it looks, but it will give you an idea on how to do it.