diff --git a/services/web/app/src/infrastructure/ExpressLocals.js b/services/web/app/src/infrastructure/ExpressLocals.js index 5f14977d3a..cca9c4352f 100644 --- a/services/web/app/src/infrastructure/ExpressLocals.js +++ b/services/web/app/src/infrastructure/ExpressLocals.js @@ -18,10 +18,6 @@ const { const { addOptionalCleanupHandlerAfterDrainingConnections, } = require('./GracefulShutdown') -const { expressify } = require('@overleaf/promise-utils') -const { - loadAssignmentsInLocals, -} = require('../Features/SplitTests/SplitTestMiddleware') const IEEE_BRAND_ID = Settings.ieeeBrandId @@ -75,10 +71,6 @@ function getWebpackAssets(entrypoint, section) { } module.exports = function (webRouter, privateApiRouter, publicApiRouter) { - webRouter.use( - expressify(loadAssignmentsInLocals(['remove-window-attributes'])) - ) - if (process.env.NODE_ENV === 'development') { // In the dev-env, delay requests until we fetched the manifest once. webRouter.use(function (req, res, next) { diff --git a/services/web/frontend/js/utils/meta.ts b/services/web/frontend/js/utils/meta.ts index 71719bcaee..b5552b6405 100644 --- a/services/web/frontend/js/utils/meta.ts +++ b/services/web/frontend/js/utils/meta.ts @@ -46,8 +46,6 @@ import { PasswordStrengthOptions } from '../../../types/password-strength-option import { Subscription as ProjectDashboardSubscription } from '../../../types/project/dashboard/subscription' import { ThirdPartyIds } from '../../../types/third-party-ids' import { Publisher } from '../../../types/subscription/dashboard/publisher' -import _ from 'lodash' -import { isSplitTestEnabled } from '@/utils/splitTestUtils' export interface Meta { 'ol-ExposedSettings': ExposedSettings @@ -248,29 +246,3 @@ export default function getMeta(name: T): Meta[T] { window.metaAttributesCache.set(name, value) return value } - -function convertMetaToWindowAttributes() { - Array.from(document.querySelectorAll('meta[name^="ol-"]')) - .map(element => (element as HTMLMetaElement).name) - // process short labels before long ones: - // e.g. assign 'foo' before 'foo.bar' - .sort() - .forEach(nameWithNamespace => { - const label = nameWithNamespace.slice('ol-'.length) - // @ts-ignore - _.set(window, label, getMeta(nameWithNamespace)) - }) -} - -// Deduplicate warning, the bootstrap-3 bundle ships its own copy of this module. -if (!window.warnedAboutWindowAttributeRemoval) { - window.warnedAboutWindowAttributeRemoval = true - // Notify any extension developers about the upcoming removal of window attributes. - // eslint-disable-next-line no-console - console.warn( - 'overleaf.com: We are sunsetting window properties like "window.project_id". If you need access to any of these, please reach out to support@overleaf.com to discuss options.' - ) -} -if (!isSplitTestEnabled('remove-window-attributes')) { - convertMetaToWindowAttributes() -} diff --git a/services/web/types/window.ts b/services/web/types/window.ts index 730b3cdb28..84213774d6 100644 --- a/services/web/types/window.ts +++ b/services/web/types/window.ts @@ -5,7 +5,6 @@ declare global { // eslint-disable-next-line no-unused-vars interface Window { metaAttributesCache: Map - warnedAboutWindowAttributeRemoval?: boolean _ide: Record & { $scope: Record & { pdf?: {