Skip to content

Accessibility Checker Extension architecture notes

Tom Brunet edited this page Jan 20, 2023 · 4 revisions

Extension messages

State

Background

  aceIBMa: Engine
  options: {
    selectedArchive: string
  }
    

Panel

Tab

Events

Background Background worker that exists through the lifecycle of the extension. Can send messages between the browser tabs and the panel

/**
 * @from Panel
 * @to Tab::DAP_CACHED_TAB
 */
DAP_CACHED {
  tabId: number
  tabURL: string
  origin: "sub" | "main"
}

/**
 * Gets the current rulesets from the checker
 * @from Panel
 */
DAP_Rulesets {
  tabId: number 
} from Panel

DAP_SCAN {
  tabId: number
  tabURL: string
  origin: "sub" | "main"
}

/**
 * Relays the report to tab and logs the scan time
 * @from Panel
 * @to Tab::DAP_SCAN_COMPLETE
 */
DAP_SCAN_TAB_COMPLETE { 
  tabId: number
  tabURL: string
  report: ACEREPORT
  archiveId: string
  policyId: string
  origin: "sub" | "main"
}

DAP_SCREENSHOT {
}

DELETE_DRAW_TABS_TO_CONTEXT_SCRIPTS {
  tabId: number
  tabURL: string
}

DRAW_TABS_TO_BACKGROUND {
  tabId: number
  tabURL: string
  tabStopsResults: IReportItem[]
  tabStopsErrors: IReportItem[]
  tabStopLines: boolean
  tabStopOutlines: boolean
}

HIGHLIGHT_TABSTOP_TO_BACKGROUND {
  tabId: number,
  tabURL: string,
  tabStopId: number
}

TAB_INFO { 
  tabId: number 
} 

Panel

TAB_UPDATED {
  tabId: number
  status?: "loading" | string
  tabUrl: string
  tabTitle: string
}

/**
 * Triggers everything the initialize as a result of a new report
 */
DAP_SCAN_COMPLETE {
  tabId: number
  tabURL: string
  report: ACEREPORT
  archiveId: string
  policyId: string
  origin: "sub" | "main"
}

TABSTOP_XPATH_ONCLICK {
  xpath: string
  circleNumber: number
}

Tab - Events sent to the browser tab

/**
 * Checks the report cache to see if a report already exists
 * @from Background
 * @return Background::DAP_SCAN_TAB_COMPLETE
 */
DAP_CACHED_TAB { 
  tabId: number
  tabURL: string
  origin: "main" | "sub"
}

DAP_SCAN_TAB {
  tabId: number
  tabURL: string
  archiveId: string
  archiveVersion: string
  policyId: string
  origin: "main" | "sub"
}

DELETE_DRAW_TABS_TO_CONTEXT_SCRIPTS {
  tabId: number
  tabURL: string
}

DRAW_TABS_TO_CONTEXT_SCRIPTS { 
  tabId: number
  tabURL: string
  tabStopsResults: IReportItem[]
  tabStopsErrors: IReportItem[]
  tabStopLines: boolean
  tabStopOutlines: boolean
  tabStopAlerts: message.tabStopAlerts // Not used?
  tabStopFirstTime: message.tabStopFirstTime // Not used?
}

HIGHLIGHT_TABSTOP_TO_CONTEXT_SCRIPTS { 
  tabId: number
  tabURL: string
  tabStopId: number
}