confluence:backgroundScript should support confluence:customContent routes

XMLWordPrintable

    • 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

      1. Create a Forge app with confluence:backgroundScript and confluence:customContent modules
      2. In the backgroundScript frontend, call invoke('functionKey') on mount
      3. Deploy and install the app on a Confluence site
      4. Create a custom content item via the Confluence  REST API
      5. Navigate to the custom content display URL: /wiki/display/:spaceKey/customcontent/:customContentId
      6. 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

              Assignee:
              Unassigned
              Reporter:
              Sumit Uniyal
              Votes:
              17 Vote for this issue
              Watchers:
              15 Start watching this issue

                Created:
                Updated: