function SendMessageToBackgroundScript( message, callback )
{
	/** @param {Error} error */
	const errorCallback = ( error ) => callback( { success: false, error: error.message } );

	try
	{
		ExtensionApi.runtime
			// @ts-ignore - janky type definitions
			.sendMessage( message )
			.then( callback )
			.catch( errorCallback );
	}
	catch( error )
	{
		if( error instanceof Error )
		{
			errorCallback( error );
		}
		else
		{
			errorCallback( new Error( String( error ) ) );
		}
	}
}
@param {{contentScriptQuery: string, [key: string]: any}} message
@param {SendMessageToBackgroundScriptCallback} callback