Loading portal/static/js/gitlab.mjs +19 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,25 @@ * to determine if the user is logged in. */ async function canAccess(imageUrl) {} /** * Checks if the browser can access the image at the given URL. This must be a valid image, otherwise * the check will always fail. * * @param {String} imageUrl A url to an image file (likely hosted on some other origin) */ async function canAccess(imageUrl) { try { await new Promise((resolve, reject) => { const img = document.createElement("img") img.addEventListener("load", resolve) img.addEventListener("error", reject) img.src = imageUrl }) return true } catch { return false } } export async function isLoggedIn() {} Loading Loading
portal/static/js/gitlab.mjs +19 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,25 @@ * to determine if the user is logged in. */ async function canAccess(imageUrl) {} /** * Checks if the browser can access the image at the given URL. This must be a valid image, otherwise * the check will always fail. * * @param {String} imageUrl A url to an image file (likely hosted on some other origin) */ async function canAccess(imageUrl) { try { await new Promise((resolve, reject) => { const img = document.createElement("img") img.addEventListener("load", resolve) img.addEventListener("error", reject) img.src = imageUrl }) return true } catch { return false } } export async function isLoggedIn() {} Loading