New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 674538 link

Starred by 3 users

Issue metadata

Status: Archived
Owner:
Last visit > 30 days ago
Closed: Mar 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Lazy fields in module system export it's value to current object if called from prototype

Reported by yavano...@yandex-team.ru, Dec 15 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.77 YaBrowser/17.1.0.1334 (beta) Yowser/2.5 Safari/537.36

Steps to reproduce the problem:
1. Install attached extension
2. Open background page inspector
3. Read console output

In this extension I mock original chrome object with dummy empty object, and place original chrome into this new mock object prototype.

let originalChrome = window.chrome;
window.chrome = {
	__proto__: originalChrome
}

Just like "overrideChrome" function in test_api.js do:
https://cs.chromium.org/chromium/src/chrome/test/data/webui/test_api.js?dr=CSs&sq=package:chromium&l=1100

Then print chrome object keys. It's expected to be empty:
console.log(Object.keys(chrome));

Then I access to management api:
console.log(chrome.management);

And then, again print chrome object keys: 
console.log(Object.keys(chrome));

What is the expected behavior?
Again i'm expecting to have empty keys list

What went wrong?
I find "management" key here. So "chrome.management" api was moved from prototype to my nested object.

WebStore page: 

Did this work before? No 

Chrome version: 55.0.2883.77  Channel: n/a
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: Shockwave Flash 24.0 r0

I thinks, this is because of LazyFieldGetterInner realization which does not take into account that this getter can be called through prototype chain
https://cs.chromium.org/chromium/src/extensions/renderer/module_system.cc?dr=CSs&sq=package:chromium&rcl=1481775657&l=494
 
extension.zip
703 bytes Download
Labels: M-55
Labels: Needs-Feedback
Thanks for the report, could you please confirm the expected result as attached to further triage it.
674538_Jan_3.png
130 KB View Download
Sorry can't see beginning of your actions on first scree, but seems it is creation something like chrome object in my demo extension.
window.chrome = {
	__proto__: originalChrome
}

So, yes. It looks like correct reproduce.

empty_extension.zip
589 bytes Download
Project Member

Comment 4 by sheriffbot@chromium.org, Jan 18 2017

Labels: -Needs-Feedback Needs-Review
Owner: durga.behera@chromium.org
Thank you for providing more feedback. Adding requester "durga.behera@chromium.org" for another review and adding "Needs-Review" label for tracking.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 5 by cda...@chromium.org, Mar 13 2017

Cleaning up "Needs-Review" label as we are not using this label for triage. Ref  bug 684919 

Comment 6 by cda...@chromium.org, Mar 13 2017

Labels: -Needs-Review
Project Member

Comment 7 by sheriffbot@chromium.org, Mar 15 2018

Status: Archived (was: Unconfirmed)
Issue has not been modified or commented on in the last 365 days, please re-open or file a new bug if this is still an issue.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment