Merge pull request #26244 from overleaf/td-limit-browser-translate-ide

Prevent browser translation of stuff that shouldn't be translated in IDE page

GitOrigin-RevId: 96a75b51c3c8efc4cbcec7eb17d9e331a03e2c96
This commit is contained in:
Tim Down
2025-06-24 08:05:32 +00:00
committed by Copybot
parent de1ab31bfd
commit ab140f578d
41 changed files with 94 additions and 29 deletions
@@ -200,7 +200,7 @@ const expectInvitePage = (user, link, callback) => {
tryFollowInviteLink(user, link, (err, response, body) => {
expect(err).not.to.exist
expect(response.statusCode).to.equal(200)
expect(body).to.match(/<title>Project Invite - .*<\/title>/)
expect(body).to.match(/<title[^>]*>Project Invite - .*<\/title>/)
callback()
})
}
@@ -210,7 +210,7 @@ const expectInvalidInvitePage = (user, link, callback) => {
tryFollowInviteLink(user, link, (err, response, body) => {
expect(err).not.to.exist
expect(response.statusCode).to.equal(404)
expect(body).to.match(/<title>Invalid Invite - .*<\/title>/)
expect(body).to.match(/<title[^>]*>Invalid Invite - .*<\/title>/)
callback()
})
}
@@ -237,7 +237,9 @@ const expectLoginPage = (user, callback) => {
tryFollowLoginLink(user, '/login', (err, response, body) => {
expect(err).not.to.exist
expect(response.statusCode).to.equal(200)
expect(body).to.match(/<title>(Login|Log in to Overleaf) - .*<\/title>/)
expect(body).to.match(
/<title[^>]*>(Login|Log in to Overleaf) - .*<\/title>/
)
callback()
})
}
@@ -12,7 +12,7 @@ export default {
restricted: {
html(response, body) {
expect(response.statusCode).to.equal(403)
expect(body).to.match(/<head><title>Restricted/)
expect(body).to.match(/<head><title translate="no">Restricted/)
},
json(response, body) {
expect(response.statusCode).to.equal(403)
@@ -1,4 +1,5 @@
const TITLE_REGEX = /<title>Your projects - .*, Online LaTeX Editor<\/title>/
const TITLE_REGEX =
/<title[^>]*>Your projects - .*, Online LaTeX Editor<\/title>/
async function run({ request, assertHasStatusCode }) {
const response = await request('/project')