MCPcopy Create free account
hub / github.com/mailru/FileAPI / checkForUrlChange

Function checkForUrlChange

flash/image/html-template/history/history.js:318–440  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

316
317 /* Called periodically to poll to see if we need to detect navigation that has occurred */
318 function checkForUrlChange() {
319
320 if (browser.ie) {
321 if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
322 //This occurs when the user has navigated to a specific URL
323 //within the app, and didn't use browser back/forward
324 //IE seems to have a bug where it stops updating the URL it
325 //shows the end-user at this point, but programatically it
326 //appears to be correct. Do a full app reload to get around
327 //this issue.
328 if (browser.version < 7) {
329 currentHref = document.location.href;
330 document.location.reload();
331 } else {
332 if (getHash() != getIframeHash()) {
333 // this.iframe.src = this.blankURL + hash;
334 var sourceToSet = historyFrameSourcePrefix + getHash();
335 getHistoryFrame().src = sourceToSet;
336 currentHref = document.location.href;
337 }
338 }
339 }
340 }
341
342 if (browser.safari) {
343 // For Safari, we have to check to see if history.length changed.
344 if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
345 //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
346 var flexAppUrl = getHash();
347 if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */)
348 {
349 // If it did change and we're running Safari 3.x or earlier,
350 // then we have to look the old state up in our hand-maintained
351 // array since document.location.hash won't have changed,
352 // then call back into BrowserManager.
353 currentHistoryLength = history.length;
354 flexAppUrl = historyHash[currentHistoryLength];
355 }
356
357 //ADR: to fix multiple
358 if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
359 var pl = getPlayers();
360 for (var i = 0; i < pl.length; i++) {
361 pl[i].browserURLChange(flexAppUrl);
362 }
363 } else {
364 getPlayer().browserURLChange(flexAppUrl);
365 }
366 _storeStates();
367 }
368 }
369 if (browser.firefox) {
370 if (currentHref != document.location.href) {
371 var bsl = backStack.length;
372
373 var urlActions = {
374 back: false,
375 forward: false,

Callers

nothing calls this directly

Calls 9

getHashFunction · 0.70
getIframeHashFunction · 0.70
getHistoryFrameFunction · 0.70
getPlayersFunction · 0.70
getPlayerFunction · 0.70
_storeStatesFunction · 0.70
handleBackButtonFunction · 0.70
handleForwardButtonFunction · 0.70
handleArbitraryUrlFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…