New issue
Advanced search Search tips

Issue 831821 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 835287
Owner: ----
Closed: Apr 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug-Regression



Sign in to add a comment

chrome.runtime is undefined in windows created by a chrome extension

Reported by knuch...@gmail.com, Apr 11 2018

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
Platform: 10452.42.0 (Official Build) beta-channel daisy

Steps to reproduce the problem:
1. Load the unpacked extension
2. Click on the icon 
3. A window will appear and if it is broken an alert will be generated saying so. The traceback can be found in the dev tools. 

What is the expected behavior?
chrome.runtime should not be undefined. Specifically, I am trying to call chrome.runtime.connect so I can create a long-lived connection to the background script of my extension.  

What went wrong?
chrome.runtime is undefined. 

Did this work before? Yes 65.0.3325.184

Does this work in other browsers? N/A

Chrome version: 66.0.3359.79  Channel: beta
OS Version: 66.0.3359.79
Flash Version: 29.0.0.134

The latest version it works in is on the stable channel. It is broken on the Beta channel
 
chrome-beta-bug.zip
36.5 KB Download

Comment 1 by woxxom@gmail.com, Apr 12 2018

Quoting https://developer.chrome.com/extensions/manifest/sandbox

  A sandboxed page will not have access to extension or app APIs, 
  or direct access to non-sandboxed pages
  (it may communicate with them via postMessage()).

Your popup.html is a sandboxed page so the observed behavior is correct.
Tested in Chrome 23-67.

Comment 2 by knuch...@gmail.com, Apr 12 2018

I've tested this on Chrome OS version 65 on the stable channel and it works and has been working. Just the recent beta channel version 66 stopped it from working. Is there something different about the beta channel or is this a recent change?

Comment 3 by knuch...@gmail.com, Apr 12 2018

Sandbox pages have been allowed to use chrome.runtime (as have all other web pages) since chrome 23. What changed in 66/67 that does not allow this to happen?
Components: Platform>Extensions
Mergedinto: 835287
Status: Duplicate (was: Unconfirmed)

Sign in to add a comment