Closed Bug 1508759 Opened 11 months ago Closed 11 months ago

Add support for hooking up permission prompts that don't use SitePermissions to TemporaryPermissions

Categories

(Firefox :: Site Identity, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
Firefox 65
Tracking Status
firefox65 --- fixed

People

(Reporter: ehsan, Assigned: ehsan)

References

Details

(Whiteboard: [privacy65])

Attachments

(1 file)

Normally, permission prompts would define a permissionKey attribute in order
to get integrated with SitePermissions.  Since SitePermissions is internally
hooked up to TemporaryPermissions, such permission prompts do not need any
extra handling for taking benefit from the temporary permissions infrastructure.

For the Storage Access API, however, we're not going to use SitePermissions,
and instead Gecko will be in charge of defining the required permissions in the
permission manager database when the prompt is responded to with an Allow
action.  This means that by default we won't be integrated with the temporary
permissions setup either.

This patch allows prompts to define a new way to get integrated with temporary
permissions.  That is, through defining a new permissionDynamicKey attribute.
This attribute will return a dynamically generated key that is unique to each
instance of the prompt.  TemporaryPermissions will do the expected work in
order to ensure that each unique prompt key will be automatically blocked if
a previous instance of the same prompt type has been blocked in the current
tab.

Note that this doesn't yet include support for showGloballyBlocked or
permitTemporaryAllow since those features aren't needed for our use case.
Blocks: 1490811
Normally, permission prompts would define a permissionKey attribute in order
to get integrated with SitePermissions.  Since SitePermissions is internally
hooked up to TemporaryPermissions, such permission prompts do not need any
extra handling for taking benefit from the temporary permissions infrastructure.

For the Storage Access API, however, we're not going to use SitePermissions,
and instead Gecko will be in charge of defining the required permissions in the
permission manager database when the prompt is responded to with an Allow
action.  This means that by default we won't be integrated with the temporary
permissions setup either.

This patch allows prompts to define a new way to get integrated with temporary
permissions.  That is, through defining a new permissionDynamicKey attribute.
This attribute will return a dynamically generated key that is unique to each
instance of the prompt.  TemporaryPermissions will do the expected work in
order to ensure that each unique prompt key will be automatically blocked if
a previous instance of the same prompt type has been blocked in the current
tab.

Note that this doesn't yet include support for showGloballyBlocked or
permitTemporaryAllow since those features aren't needed for our use case.
Component: General → Site Identity and Permission Panels
Priority: -- → P1
Whiteboard: [privacy65]
Attachment #9026495 - Attachment description: Bug 1508759 - Add support for hooking up permission prompts that don't use SitePermissions to TemporaryPermissions → Bug 1508759 - Add support for hooking up permission prompts that don't use SitePermissions to TemporaryPermissions; r=johannh
Attachment #9026495 - Attachment description: Bug 1508759 - Add support for hooking up permission prompts that don't use SitePermissions to TemporaryPermissions; r=johannh → Bug 1508759 - Add support for hooking up permission prompts that don't use SitePermissions to TemporaryPermissions
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b1b57d2da9b1
Add support for hooking up permission prompts that don't use SitePermissions to TemporaryPermissions r=johannh
https://hg.mozilla.org/mozilla-central/rev/b1b57d2da9b1
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 65
You need to log in before you can comment on or make changes to this bug.