WordPress.org

Make WordPress Core

Opened 4 months ago

Last modified 4 months ago

#46132 new defect (bug)

Opera changed its render engine to Chrome, $is_opera not working

Reported by: brasofilo Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 2.2
Component: General Keywords: needs-patch
Focuses: Cc:

Description

Attachments (1)

46132.diff (1.0 KB) - added by brasofilo 4 months ago.
Patch for $is_opera correction

Download all attachments as: .zip

Change History (3)

#1 @desrosj
4 months ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release
  • Version changed from 5.0.2 to 2.2

Thanks for the ticket, @brasofilo!

I did some digging, and this Opera check appears to originally have come from b2 (fun!).

Since Opera now uses Chromium, I'd be curious if $is_opera related conditionals throughout core can be removed in favor of $is_chrome. Differences in the browser's behaviors should be looked into, though.

For reference, here is the official documentation for the Opera's user agent.

@brasofilo are you interested in creating a patch for this?

#2 @brasofilo
4 months ago

Thanks for taking a look, @desrosj

I discovered this when I needed a specific CSS rule for Opera (using the body_class filter). And that's because Chrome has an ongoing bug not present in Opera: we can't drag bookmarklets into the bookmarks bar since Chrome 69.
I don't think it'd be a good idea to convert $is_opera to $is_chrome, this kind of mishap among browsers is bound to happen even if everybody changes their render-engine to Chromium :)

I'm attaching the needed patch, hope the format is correct.
Checking for Opera has to be done before Chrome's so as not to give a false positive.

@brasofilo
4 months ago

Patch for $is_opera correction

Note: See TracTickets for help on using tickets.