Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Firefox #117

Open
karlcow opened this issue Feb 4, 2020 · 0 comments
Open

Add support for Firefox #117

karlcow opened this issue Feb 4, 2020 · 0 comments

Comments

@karlcow
Copy link

karlcow commented Feb 4, 2020

this is a followup on webcompat/web-bugs#32764 (comment)

Currently roll-call doesn't support firefox through user agent sniffing. But when we are faking the chrome ua on firefox, everything is working.

roll-call/index.js

Lines 10 to 14 in b9aab14

const getChromeVersion = (force) => {
if (force) return true
var raw = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)
return raw ? parseInt(raw[2], 10) > 59 : false
}

roll-call/index.js

Lines 64 to 89 in b9aab14

window.addEventListener('WebComponentsReady', () => {
let url = new URL(window.location)
let room = url.searchParams.get('room')
let force = url.searchParams.get('force')
if (window.location.search && getChromeVersion(force) && room) {
require('./components')
container.innerHTML = `${help}<roll-call call="${room}"></roll-call>`
dragDrop('body', files => {
document.querySelector('roll-call').serveFiles(files)
})
} else {
container.innerHTML = welcome
if (!getChromeVersion(force)) {
document.querySelector('span.start-text').innerHTML = onlyChrome
}
each(document.querySelectorAll('welcome-message span'), elem => {
elem.onclick = () => {
let room
if (elem.id === 'start-party') room = 'party'
else room = random()
window.location = window.location.pathname + '?room=' + room
}
})
}
})

these two blocks of code have to be modified.

A pr is welcome for this so the product is based on feature detection instead of user agent sniffing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant