@sonahri501 i will explain you
we can see that in your firefox url there's a space in
?doc=invalid" onload=alert(1) <- between " and onload
and firefox doesnt url encode the space to %20 automatically but chrome does
?doc=invalid" onload=alert(1)
?doc=invalid"%20onload=alert(1)