-
Type:
Suggestion
-
Resolution: Unresolved
-
Component/s: Extensibility - Custom Content
-
1
Issue Summary
The confluence:backgroundScript module does not support confluence:customContent routes. When a background script attempts to call invoke(), realtime.subscribe(), or any other Forge bridge method requiring a context token on a custom content page (/display/:spaceKey/customcontent/:customContentId), the platform rejects the token generation with "Action not permitted". The background script iframe loads successfully on the route, but all bridge methods requiring a context token are blocked because BackgroundScriptContextValidator does not recognize CustomContentEntityObject as a valid content type.
This limitation prevents Forge apps from using background scripts for realtime collaboration, notifications, and background data sync on custom content pages — capabilities that work correctly on globalPage, spacePage, and standard page/blogpost views.
Steps to Reproduce
- Create a Forge app with confluence:backgroundScript and confluence:customContent modules
- In the backgroundScript frontend, call invoke('functionKey') on mount
- Deploy and install the app on a Confluence site
- Create a custom content item via the Confluence REST API
- Navigate to the custom content display URL: /wiki/display/:spaceKey/customcontent/:customContentId
- Open DevTools → Console
Expected Results
invoke() and other bridge methods (realtime.subscribe(), requestConfluence()) should succeed on the custom content route, the same as they do on globalPage, spacePage, and standard page/blogpost routes.
Actual Results
The following error is thrown in the browser console:
Error: Failed to get context token: Token generation failed: Action not permitted.
Workaround
Currently there is no known workaround for this behavior. A workaround will be added here when available