How tigerzplace/fap-facebookautoposter works
1. This is a Chrome extension, not a standalone web app. The runtime is split across extension pages (popup.html, background.html, frame.html), a content script injected into Facebook pages, and a set of shared “core” modules under scripts/core.
2. The central user-facing surface is the dashboard UI. pages/popup.html opens the extension experience, and the dashboard logic in scripts/core/dashboard.js drives the campaign builder: group selection, post composition, delay settings, image selection, campaign loading/saving, and start/pause/resume controls.
3. Facebook page interaction is handled separately from the UI. scripts/content.js and scripts/core/fb.js are the automation layer that read and manipulate Facebook’s DOM in the current tab, so posting happens through the browser interface rather than a public Facebook API.
4. The posting workflow is orchestration-heavy. The dashboard sends a campaign to the background/orchestration layer, which sequences posts one group at a time, applies wait times, tracks progress, and coordinates retries, pause/resume, and completion handling.
5. The background subsystem lives under scripts/background/ and is likely responsible for persistent extension behavior: background.js as the long-lived coordinator, plus fix.js and get_host.js for host/tab handling and reliability fixes. This is where cross-tab control and single-instance protection would live.
6. Image posting is its own pipeline. scripts/core/imageUpload.js handles file selection, upload progress, preview state, and re-upload on retry. It is integrated into the campaign flow so the same image can be attached across multiple group posts.
7. Link preview and post composition are managed in the core layer. scripts/core/api.js, scripts/core/functions.js, and scripts/core/frame.js appear to support shared utilities, remote preview fetching, and helper-frame behavior used by the dashboard/posting flow.
8. Campaign state is a first-class concept. The README features map to logic for saved campaigns, saved group lists, multiple post variants, delay presets, smart delay recommendations, and post-run summaries. These are likely persisted locally via extension storage rather than a backend.
9. The extension also has a small external-service boundary. scripts/core/terms.js and scripts/core/api.js suggest calls to Tigerzplace services for licensing/activation and possibly feature gating or metadata, while scripts/ads.json looks like remote/config-driven promotional content.
10. The data flow is: user configures a campaign in the dashboard → campaign state is handed to the background/orchestrator → the orchestrator drives the Facebook automation layer on the active tab → success/failure and direct post URLs are streamed back to the dashboard for logs, counters, and the final summary modal.
11. The static assets and styles are purely presentation concerns. assets/ contains icons, images, and logos; styles/ contains the extension UI styling. They do not affect the automation architecture, but they support the dashboard and licensing pages.
12. The documentation under docs/ is operational rather than runtime logic. It provides tutorials, release notes, and Git/license guidance, which is useful context for understanding intended workflows but not part of the execution path.
Main entry points: dashboard.js Dashboard · background.js Coordinator · content.js Content Script · frame.html Helper Frame
Components 18
Extension UI
User-facing extension pages and presentation assets.
- Popup UI · Entry point for the extension experience.
pages/popup.html - Dashboard · Campaign builder and control surface for selecting groups, composing posts, setting delays, and managing start/pause/resume.
scripts/core/dashboard.js - Styles · Presentation styles for the extension pages.
styles/main.css
Orchestration
Long-lived background coordination and campaign execution.
- Background Page · Hidden extension page hosting persistent background behavior.
pages/background.html - Coordinator · Long-lived campaign orchestrator that sequences posts and manages persistence, retries, and completion.
scripts/background/background.js - Reliability Fixes · Host and tab handling fixes for stable extension behavior.
scripts/background/fix.js - Host Resolver · Resolves target host/tab context for cross-tab control.
scripts/background/get_host.js
Facebook Automation
Content-side DOM interaction and posting automation in Facebook tabs.
- Content Script · Injected script that bridges the extension with Facebook pages.
scripts/content.js - FB Automation · Facebook page interaction layer for reading and manipulating the current tab.
scripts/core/fb.js
Shared Core
Reusable logic for campaign state, composition, uploads, and service access.
- Helper Frame · Frame page used as part of the posting or preview workflow.
pages/frame.html - Frame Logic · Shared frame behavior used by the dashboard and posting flow.
scripts/core/frame.js - API Layer · Shared remote/service access used for preview or metadata fetching.
scripts/core/api.js - Core Utils · General utility functions supporting the campaign flow.
scripts/core/functions.js - Image Upload · Image selection, progress tracking, preview state, and retry upload handling.
scripts/core/imageUpload.js - Licensing · Terms, activation, or feature-gating boundary to Tigerzplace services.
scripts/core/terms.js - Promos · Config-driven promotional content.
scripts/ads.json
Assets & Docs
Static resources and operational documentation.
- Media Assets · Icons, images, and logos used by the extension.
assets - Docs · Tutorials, release notes, and usage guidance.
docs
Connections 18
- Popup UI → Dashboard: opens · Popup launches the dashboard experience.
- Dashboard → Coordinator: campaigns · Sends campaign state to the background orchestrator.
- Coordinator → Content Script: dispatches · Coordinates the content script in the active Facebook tab.
- Content Script → FB Automation: uses · Content script relies on the Facebook DOM automation layer.
- Coordinator → Reliability Fixes: stabilizes · Uses reliability helpers for tab and host handling.
- Coordinator → Host Resolver: resolves · Determines the target host/tab context.
- Dashboard → Image Upload: attaches · Connects image selection and retry state to campaigns.
- Dashboard → API Layer: fetches · Uses shared remote access for previews or metadata.
- Dashboard → Core Utils: shares · Reuses common helpers for campaign composition.
- Dashboard → Licensing: checks · Touches licensing or activation gating.
- Dashboard → Helper Frame: loads · Uses the helper frame page during the workflow.
- Helper Frame → Frame Logic: runs · Frame page hosts the shared frame logic.
- Coordinator → Frame Logic: coordinates · Background coordination may use shared frame behavior.
- Image Upload → FB Automation: posts media · Image pipeline feeds the Facebook posting flow.
- API Layer → Promos: configures · Remote/config-driven content supports the extension experience.
- Dashboard → Media Assets: renders · UI uses static icons and images.
- Dashboard → Docs: documents · Operational docs describe the intended workflow.
- Background Page → Coordinator: hosts · Background page hosts the persistent coordinator.