MCPcopy Index your code
hub / github.com/ionic-team/capacitor / convertFileSrcServerUrl

Function convertFileSrcServerUrl

core/native-bridge.ts:153–164  ·  view source on GitHub ↗
(webviewServerUrl: string, filePath: string)

Source from the content-addressed store, hash-verified

151 };
152
153 const convertFileSrcServerUrl = (webviewServerUrl: string, filePath: string): string => {
154 if (typeof filePath === 'string') {
155 if (filePath.startsWith('/')) {
156 return webviewServerUrl + '/_capacitor_file_' + filePath;
157 } else if (filePath.startsWith('file://')) {
158 return webviewServerUrl + filePath.replace('file://', '/_capacitor_file_');
159 } else if (filePath.startsWith('content://')) {
160 return webviewServerUrl + filePath.replace('content:/', '/_capacitor_content_');
161 }
162 }
163 return filePath;
164 };
165
166 const initEvents = (win: WindowCapacitor, cap: CapacitorInstance) => {
167 cap.addListener = (pluginName, eventName, callback) => {

Callers 1

initNativeBridgeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected