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

Function checkForUrlChange

flash/camera/html-template/history/history.js:309–430  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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