Skip to content
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

add script tag to the head instead #2244

Merged
merged 1 commit into from
Nov 28, 2022
Merged

Conversation

patricklx
Copy link
Collaborator

@patricklx patricklx commented Nov 18, 2022

fixes #2243
with this it wont be intercepted by the wordpress editor

@patricklx patricklx closed this Nov 18, 2022
@patricklx patricklx reopened this Nov 18, 2022
@patricklx patricklx changed the title remove script tag once code as been executed remove script tag immediately once code as been executed Nov 18, 2022
@patricklx patricklx changed the title remove script tag immediately once code as been executed add script tag to the head instead Nov 18, 2022
@RobbieTheWagner
Copy link
Member

@patricklx could this cause potential timing issues?

@patricklx
Copy link
Collaborator Author

I don't think there should be any timing issue. Or what do you mean. At least the loaded script waits for the page load to complete and then executes the code

@RobbieTheWagner
Copy link
Member

I don't think there should be any timing issue. Or what do you mean. At least the loaded script waits for the page load to complete and then executes the code

I mean moving to executing in the head will make it run earlier. Could there be things that are not ready at that time? I would assume we were putting it in the body for a reason before?

@patricklx
Copy link
Collaborator Author

I just checked the history of the script tag, and indeed in older versions it was depending on jQuery to subscribe to page load. Now its not using any library. So it can be safely loaded in the head tag

@RobbieTheWagner RobbieTheWagner merged commit 6b43738 into emberjs:main Nov 28, 2022
@patricklx patricklx deleted the patch-4 branch February 3, 2023 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

in-page-script.js inserted into Wordpress editor
2 participants