Make WordPress Core

Opened 9 years ago

Last modified 5 years ago

#34933 new defect (bug)

postMessage - targetOrigin does not contains port number

Reported by: ctomczyk's profile ctomczyk Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.9
Component: Upgrade/Install Keywords:
Focuses: Cc:

Description

Current behavior

When the skins are upgraded then the communication to the parent node using postMessage is blocked when the user is on the URL that has specified port. Example: example.com:81.

I see in console:

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('http://localhost') does not match the recipient window's origin ('http://localhost:81').

Expected behavior

File wp-admin\includes\class-wp-upgrader-skins.php line 168 contains:

window.parent.postMessage( JSON.stringify( { action: "decrementUpdateCount", upgradeType: "' . $type . '" } ), window.location.protocol + "//" + window.location.hostname );

The targetOrigin for the postMessage should also contains port number. E.g. window.location.hostname + window.location.port

Attachments (1)

missing_port.png (37.5 KB) - added by ctomczyk 9 years ago.
The message in console

Download all attachments as: .zip

Change History (3)

@ctomczyk
9 years ago

The message in console

This ticket was mentioned in Slack in #core by wonderboymusic. View the logs.


9 years ago

#2 @wonderboymusic
9 years ago

  • Version changed from 4.4 to 3.9
Note: See TracTickets for help on using tickets.