This repository has been archived by the owner on Apr 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 333
Add fallback runScript insertion location #144
Open
stffrd
wants to merge
5
commits into
bestiejs:main
Choose a base branch
from
stffrd:master
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jdalton
force-pushed
the
master
branch
2 times, most recently
from
July 18, 2016 17:00
bb3864c
to
b5cb520
Compare
jdalton
force-pushed
the
master
branch
2 times, most recently
from
July 24, 2016 22:34
3aca059
to
189eda5
Compare
@Morklympious can you rebase this PR? |
@jdalton Sure thing, will do later tonight! |
And just for my own understanding, @jdalton when you say "rebase this PR", do you mean rebase the changes from upstream's master into my own master and then re-push the change? Helps me not mess it up in the future! |
Yep. To remove the commits unrelated to this PR. |
jdalton
force-pushed
the
master
branch
5 times, most recently
from
August 2, 2016 03:11
da00022
to
e156ebc
Compare
jdalton
force-pushed
the
master
branch
2 times, most recently
from
August 8, 2016 16:47
b08353e
to
f118abf
Compare
There's an issue wherein having no script tags on the page (but having the js in memory executing) causes errors since runScript has no reference point to inject scripts. This commit allows for two cases: 1) If there are no script tags on the page, it will grab the last element node in the body and insert scripts next to that element. 2) If there are no script tags on the page and the body element is EMPTY, a script tag will be created and appended to body. Subsequent calls to runScript will allow the first use case of inserting next to scripts to be called.
Interesting that I rebased and they're showing in my git log locally, but they aren't removed by the PR. |
jdalton
force-pushed
the
master
branch
3 times, most recently
from
September 26, 2016 04:41
572f88b
to
10319e4
Compare
jdalton
force-pushed
the
master
branch
2 times, most recently
from
October 6, 2016 04:09
8b41e34
to
ea48e72
Compare
jdalton
force-pushed
the
master
branch
2 times, most recently
from
October 6, 2016 15:30
7d00d55
to
115bc9d
Compare
jdalton
force-pushed
the
master
branch
4 times, most recently
from
November 22, 2016 05:35
2f014b6
to
c732675
Compare
jdalton
force-pushed
the
master
branch
2 times, most recently
from
December 24, 2016 15:51
f263303
to
a37c36c
Compare
jdalton
force-pushed
the
master
branch
2 times, most recently
from
February 6, 2017 06:03
fa368bc
to
7c31726
Compare
jdalton
force-pushed
the
master
branch
2 times, most recently
from
March 6, 2017 02:46
e87b3c3
to
70a8b8b
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There's an issue wherein having no script tags on the page (but having the
js in memory executing) causes errors since runScript has no reference
point to inject scripts.
This commit allows for two cases:
If there are no script tags on the page, it will grab the last element
node in the body and insert scripts next to that element.
If there are no script tags on the page and the body element is EMPTY,
a script tag will be created and appended to body. Subsequent calls to
runScript will allow the first use case of inserting next to scripts to be
called.
This still passes the tests, and I was able to verify the creation of a new
script
tag after stepping through my debugger and deleting the contents ofdocument.body
.If there's anything I can do to make this better/more acceptable, please let me know! The tests seem sort of nebulous to me at this point? only because I guess there isn't a test suite for
runScript
! hahaha.P.S. My commit that says 'convert to tabs' is actually supposed to be 'convert to spaces'. Oops.