New issue
Advanced search Search tips

Issue 759473 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 759474
Owner: ----
Closed: Aug 2017
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

sender.frameId is empty for messages sent from background child frame

Reported by siria...@gmail.com, Aug 28 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36

Steps to reproduce the problem:
Append iframe in background page and send message from content script of this frame. 

Easier way to reproduce:

1. manifest.json:
{
  "name": "Test",
  "manifest_version": 2,
  "version": "0.1",
  "content_scripts": [
    {
      "js": [
        "content.js"
      ],
      "matches": ["<all_urls>"],
      "run_at": "document_start",
      "all_frames": true
    }
  ],
  "background": {
    "scripts": ["background.js"]
  }
}

2. content.js
chrome.runtime.sendMessage('');

3. background.js

chrome.runtime.onMessage.addListener((m,sender) => console.log(sender));

function test() {
    let frame = document.createElement('frame');
    frame.src = 'https://example.org';
    document.body.appendChild(frame);
}

if (document.body) {
    test()
} else {
    document.addEventListener("DOMContentLoaded", test);
}

What is the expected behavior?
At least sender.frameId must not be empty. Because child frame 100% HAS unique frameId (you could check it using for example chrome.webRequest API)

What went wrong?
sender object contains only "id" and "url" properties. But must also contain at least "frameId" property

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 60.0.3112.113  Channel: stable
OS Version: OS X 10.12.5
Flash Version:
 
Mergedinto: 759474
Status: Duplicate (was: Unconfirmed)

Sign in to add a comment