Skip to content

Commit

Permalink
removed chrome hack (#26202)
Browse files Browse the repository at this point in the history
  • Loading branch information
fitzage authored Nov 8, 2024
1 parent b13d3ed commit 3b5b8ff
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
4 changes: 1 addition & 3 deletions assets/scripts/components/codetabs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getQueryParameterByName } from '../helpers/browser';
import { getCookieByName, chromeHashFix } from '../helpers/helpers';
import { getCookieByName } from '../helpers/helpers';
import regionConfig from '../config/regions.config';

const initCodeTabs = () => {
Expand Down Expand Up @@ -105,13 +105,11 @@ const initCodeTabs = () => {
}
}else{
activateCodeTab(firstTab)
chromeHashFix();
}
} else {
if (codeTabsList.length > 0) {
activateCodeTab(firstTab)
}
chromeHashFix();
}
}

Expand Down
4 changes: 1 addition & 3 deletions assets/scripts/datadog-docs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import configDocs from './config/config-docs';
import { updateMainContentAnchors, gtag, chromeHashFix } from './helpers/helpers';
import { updateMainContentAnchors, gtag } from './helpers/helpers';
import { bodyClassContains } from './helpers/helpers';
import { DOMReady } from './helpers/documentReady';
import { initializeIntegrations } from './components/integrations';
Expand Down Expand Up @@ -122,8 +122,6 @@ const doOnLoad = () => {

if (document.querySelector('.code-tabs')) {
initCodeTabs();
} else {
chromeHashFix();
}
};

Expand Down
13 changes: 1 addition & 12 deletions assets/scripts/helpers/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,6 @@ const getCookieByName = (name) => {
return value;
};

const chromeHashFix = () => {
const isChrome = /Chrome/.test(navigator.userAgent);
if (window.location.hash && isChrome) {
setTimeout(function () {
const hash = window.location.hash;
window.location.hash = '';
window.location.hash = hash;
}, 300);
}
}

const bodyClassContains = (string) => document.body.classList.contains(string);

export { updateMainContentAnchors, reloadWistiaVidScripts, gtag, getCookieByName, bodyClassContains, chromeHashFix };
export { updateMainContentAnchors, reloadWistiaVidScripts, gtag, getCookieByName, bodyClassContains };

0 comments on commit 3b5b8ff

Please sign in to comment.