Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upI don't understand how the new mozbrowser API privilege works #11498
Comments
|
Here is a test (load a.html in servo): <!-- a.html -->
<iframe mozbrowser="true" src="b.html"></iframe>
<script>
var iframe = document.querySelector("iframe");
iframe.addEventListener("mozbrowserloadend", _ => {
console.log("a.html: mozbrowser event");
});
setTimeout(() => {
console.log("a.html: " + iframe.goForward);
try {
iframe.goForward();
console.log("a.html goForward() succeeded");
} catch(e) {
console.log("a.html goForward() failed: " + e);
}
}, 2000);
</script><!-- b.html -->
<iframe mozbrowser="true" src="data:,c"></iframe>
<script>
var iframe = document.querySelector("iframe");
iframe.addEventListener("mozbrowserloadend", _ => {
console.log("b.html: mozbrowser event");
});
setTimeout(() => {
console.log("b.html: " + iframe.goForward);
try {
iframe.goForward();
console.log("b.html goForward() succeeded");
} catch(e) {
console.log("b.html goForward() failed: " + e);
}
}, 1000);
</script>Without the pref, I see:
We should see:
With the pref I see:
We should see:
|
|
So I should restore some of the checks in |
bors-servo
added a commit
that referenced
this issue
May 30, 2016
Fix permissions of mozbrowser and BrowserElementPrivileged (fixes #11498) <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11508) <!-- Reviewable:end -->
avadacatavra
added a commit
to avadacatavra/servo
that referenced
this issue
Jun 10, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maybe I missed something in the recent changes in the mozbrowser API, and codegen (#11308 and #11465), but:
The interface
BrowserElementPrivilegeddescribes special methods that should be only available if:<iframe>is in the top level document,<iframe>has amozbrowserattributedom.enabled.mozbrowseris set to trueIn HTMLIFrameElement.webidl it says:
HTMLIFrameElement implements BrowserElement;without any condition.I see
[Func="Window::global_is_mozbrowser"]for themozbrowserattribute, but not for all the other methods.So if I'm not mistaken, that means that all the mozbrowser methods will be visible from any iframe, no matter what (even if the 3 conditions are not met) and only throw if 2 is false?
Also -
HTMLIFrameElement.mozbrowseris only available ifWindow::global_is_mozbrowser, but that doesn't prevent me to doiframe.setAttribute("mozbrowser", true), does it?I'm under the impression that: