From 95827a4a3327fb67a31afb30e008edf65b98a000 Mon Sep 17 00:00:00 2001 From: "rajkumar.duvva" Date: Thu, 7 Dec 2017 16:01:26 +0530 Subject: [PATCH 1/2] updated the code for new state empty title issue. --- scripts/bundled-uncompressed/html4+html5/native.history.js | 7 +++++-- scripts/bundled-uncompressed/html5/native.history.js | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/bundled-uncompressed/html4+html5/native.history.js b/scripts/bundled-uncompressed/html4+html5/native.history.js index e272e9ba..0732ef8e 100644 --- a/scripts/bundled-uncompressed/html4+html5/native.history.js +++ b/scripts/bundled-uncompressed/html4+html5/native.history.js @@ -2596,10 +2596,13 @@ if (typeof JSON !== 'object') { // Apply try { - document.getElementsByTagName('title')[0].innerHTML = title.replace('<','<').replace('>','>').replace(' & ',' & '); + if(title != "") //Don't update the document title if newState title is empty. + document.getElementsByTagName('title')[0].innerHTML = title.replace('<','<').replace('>','>').replace(' & ',' & '); } catch ( Exception ) { } - document.title = title; + + if(title != "") //Don't update the document title if newState title is empty. + document.title = title; // Chain return History; diff --git a/scripts/bundled-uncompressed/html5/native.history.js b/scripts/bundled-uncompressed/html5/native.history.js index 84532d79..c4032dde 100644 --- a/scripts/bundled-uncompressed/html5/native.history.js +++ b/scripts/bundled-uncompressed/html5/native.history.js @@ -1426,10 +1426,13 @@ // Apply try { - document.getElementsByTagName('title')[0].innerHTML = title.replace('<','<').replace('>','>').replace(' & ',' & '); + if(title != "") //Don't update the document title if newState title is empty. + document.getElementsByTagName('title')[0].innerHTML = title.replace('<','<').replace('>','>').replace(' & ',' & '); } catch ( Exception ) { } - document.title = title; + + if(title != "") //Don't update the document title if newState title is empty. + document.title = title; // Chain return History; From ad02b23a316bf63bbd4161f1100d32aa22ce1df0 Mon Sep 17 00:00:00 2001 From: "rajkumar.duvva" Date: Thu, 7 Dec 2017 20:43:48 +0530 Subject: [PATCH 2/2] updated title condition with empty,null and undefined. --- scripts/bundled-uncompressed/html4+html5/native.history.js | 4 ++-- scripts/bundled-uncompressed/html5/native.history.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/bundled-uncompressed/html4+html5/native.history.js b/scripts/bundled-uncompressed/html4+html5/native.history.js index 0732ef8e..db5efb36 100644 --- a/scripts/bundled-uncompressed/html4+html5/native.history.js +++ b/scripts/bundled-uncompressed/html4+html5/native.history.js @@ -2596,12 +2596,12 @@ if (typeof JSON !== 'object') { // Apply try { - if(title != "") //Don't update the document title if newState title is empty. + if(title) //Don't update the document title if newState title is empty/undefined. document.getElementsByTagName('title')[0].innerHTML = title.replace('<','<').replace('>','>').replace(' & ',' & '); } catch ( Exception ) { } - if(title != "") //Don't update the document title if newState title is empty. + if(title) //Don't update the document title if newState title is empty/undefined. document.title = title; // Chain diff --git a/scripts/bundled-uncompressed/html5/native.history.js b/scripts/bundled-uncompressed/html5/native.history.js index c4032dde..6b9dad90 100644 --- a/scripts/bundled-uncompressed/html5/native.history.js +++ b/scripts/bundled-uncompressed/html5/native.history.js @@ -1426,12 +1426,12 @@ // Apply try { - if(title != "") //Don't update the document title if newState title is empty. + if(title) //Don't update the document title if newState title is empty/undefined. document.getElementsByTagName('title')[0].innerHTML = title.replace('<','<').replace('>','>').replace(' & ',' & '); } catch ( Exception ) { } - if(title != "") //Don't update the document title if newState title is empty. + if(title) //Don't update the document title if newState title is empty/undefined. document.title = title; // Chain