Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#37125 closed defect (bug) (fixed)

Shiny Updates: postMessage and browser extensions conflict

Reported by: afercia Owned by: swissspidy
Priority: normal Milestone: 4.6
Component: Upgrade/Install Version: 3.9
Severity: normal Keywords: has-patch
Cc: Focuses: javascript

Description (last modified by afercia)

Noticed in Chrome, using the "Accessibility Developer Tools" extension, see https://github.com/GoogleChrome/accessibility-developer-tools-extension

Looks like some browser extensions may use postMessage and conflict with the updates postMessage events:

https://cldup.com/57EOl9W2a0.png

In this case, the "Accessibility Developer Tools" extension triggers two "message" events when opening the plugin details modal and passes as data an object.

Maybe, in 'updates.js' it would be safer to check if the event data is a string before trying to parse it because this line:
message = $.parseJSON( originalEvent.data );
assumes originalEvent.data is a well-formed JSON string while browser extensions or maybe also plugins might pass other types of data.

Attachments (1)

37125.diff (415 bytes ) - added by swissspidy 10 years ago.

Download all attachments as: .zip

Change History (8)

This ticket was mentioned in Slack in #feature-shinyupdates by swissspidy. View the logs.


10 years ago

#2 @afercia
10 years ago

  • Description modified (diff)

#3 @swissspidy
10 years ago

  • Component PluginsUpgrade/Install
  • Milestone Awaiting Review4.6
  • Owner set to swissspidy
  • Status newassigned

We might be able to use wp.updates.isValidResponse() inside the postMessage handler.

This ticket was mentioned in Slack in #feature-shinyupdates by swissspidy. View the logs.


10 years ago

#5 @swissspidy
10 years ago

  • Keywords needs-patch added
  • Summary Plugin updates postMessage and browser extensions conflictShiny Updates: postMessage and browser extensions conflict

@swissspidy
10 years ago

#6 @swissspidy
10 years ago

  • Keywords has-patch added; needs-patch removed

Actually, a simple try {} catch() {} is enough.

#7 @swissspidy
10 years ago

  • Resolutionfixed
  • Status assignedclosed

Fixed in [37976]

Note: See TracTickets for help on using tickets.