-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Dummy app hitting recently added assertion (#188)
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* This is here just for dummy app. | ||
* | ||
* Without it we would hit assertion from service:page-title-list | ||
* because of our app/index.html has 2 <title> elements due to Fastboot. | ||
* | ||
* But having 2 <title> elements is intentional so we can acceptance test both | ||
* browser and Fastboot scenarios together. | ||
*/ | ||
export function initialize(/* application */) { | ||
if (typeof FastBoot === 'undefined') { | ||
let titleElements = document.head.getElementsByTagName('title'); | ||
let defaultTitle = titleElements.item(0); | ||
if (defaultTitle && titleElements.length > 1) { | ||
defaultTitle.parentElement.removeChild(defaultTitle); | ||
} | ||
} | ||
} | ||
|
||
export default { | ||
initialize | ||
}; |