You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suggest somewhere the message type definitions for those between a webpage and an ContentScript injected by an extension are defined in a separate .ts. Something like the following example:
// Message types from content script to page
const PAGE_POST_TYPE = Object.freeze({
SIGNIFY_EXT: "signify-extension",
SELECT_AUTO_SIGNIN: "select-auto-signin",
SIGNIFY_SIGNATURE: "signify-signature"
})
// interfaces for the messages posted to the web page
interface ICsPageMsg {
type: any
version: string
}
interface ICsPageSignifyExtensionMsg extends ICsPageMsg {
type: typeof PAGE_POST_TYPE.SIGNIFY_EXT;
version: "0.0.1"
data: {
extensionId: string;
};
}
...
With these, a browser extension developer then can import these definition and use the ones it needs.
A webpage developer can import and use the ones it needs.
The text was updated successfully, but these errors were encountered:
Typescript will avoid some errors.
Suggest somewhere the message type definitions for those between a webpage and an ContentScript injected by an extension are defined in a separate .ts. Something like the following example:
// Message types from page to content script
const PAGE_EVENT_TYPE = Object.freeze({
SELECT_IDENTIFIER: "select-identifier",
SELECT_CREDENTIAL: "select-credential",
SELECT_ID_CRED: "select-aid-or-credential",
SELECT_AUTO_SIGNIN: "select-auto-signin",
NONE: "none",
VENDOR_INFO: "vendor-info",
FETCH_RESOURCE: "fetch-resource",
AUTO_SIGNIN_SIG: "auto-signin-sig",
SIGNIFY_EXTENSION: "signify-extension"
})
// Message types from content script to page
const PAGE_POST_TYPE = Object.freeze({
SIGNIFY_EXT: "signify-extension",
SELECT_AUTO_SIGNIN: "select-auto-signin",
SIGNIFY_SIGNATURE: "signify-signature"
})
// interfaces for the messages posted to the web page
interface ICsPageMsg {
type: any
version: string
}
interface ICsPageSignifyExtensionMsg extends ICsPageMsg {
type: typeof PAGE_POST_TYPE.SIGNIFY_EXT;
version: "0.0.1"
data: {
extensionId: string;
};
}
...
With these, a browser extension developer then can import these definition and use the ones it needs.
A webpage developer can import and use the ones it needs.
The text was updated successfully, but these errors were encountered: