feat(client): add title URL param to override document title#399
Open
joshfriend wants to merge 1 commit into
Open
feat(client): add title URL param to override document title#399joshfriend wants to merge 1 commit into
joshfriend wants to merge 1 commit into
Conversation
Titles are hardcoded per client type (Stream, Shell, Devtools, etc.). Parse an optional 'title' into ParamsBase alongside the other shared params, and use it in BaseClient.setTitle to override the automatic title. Lets an embedded or popped-out client show a meaningful document title. Falls back to the automatic title when the param is absent.
5f52818 to
a868ea3
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds an optional
titleURL param that overrides the automatic document title.Client titles are currently hardcoded per type (
Stream <deviceName>,Shell <udid>,Devtools <udid>,Listing <serial>,<deviceName>. Configure stream). When a client is embedded in an iframe or opened in a detached/popup window, there's no way to give it a meaningful tab/window title.This parses
titleintoParamsBasealongside the other shared params (useProxy,secure,hostname, ...), so every client picks it up through the existingsuper.parseParameters()chain.BaseClient.setTitlethen prefersparams.titleover the automatic title. When the param is absent, behavior is unchanged.Example:
Also appends the
<title>element to<head>in the (previously dead) branch that creates one, so the fallback actually works.