Documentation Index
Fetch the complete documentation index at: https://docs.dynamic.xyz/docs/llms.txt
Use this file to discover all available pages before exploring further.
Google Play Store Approval Guide
When submitting browser extensions to the Google Play Store, you may encounter specific restrictions that can lead to rejection. This guide covers common issues and their solutions.
Remote Code Loading in Manifest V3
The Issue
Google Play Store prohibits Manifest V3 extensions from loading remotely hosted code. A common violation occurs when your extension bundle includes code that loads external scripts, such as the AppleID script from https://appleid.cdn-apple.com/.
Solution: Replacing Remote Loaders
To resolve this issue, you can configure your bundler to replace remote script loaders with local dummy files. We provide solutions for both Vite and Webpack bundlers.
Step 1: Create a dummy loader file
First, create a dummy loader file that will replace the remote script loader:
// src/loadAppleId.js
"use client";
const loadAppleId = () => {};
export { loadAppleId };
Option 1: Using Vite
Configure Vite to alias the remote loader to your dummy file:
// vite.config.ts
import { defineConfig } from "vite";
import path from "path";
const replaceLoadAppleIdScriptWithCustomScriptPlugin = {
name: "replace-loadAppleId",
enforce: "pre",
resolveId(source) {
if (source.includes("loadAppleId")) {
return path.resolve(__dirname, "src/loadAppleId.js");
}
},
} as const;
export default defineConfig({
plugins: [react(), replaceLoadAppleIdScriptWithCustomScriptPlugin],
// ... other config options
});
Option 2: Using Webpack
Configure Webpack to alias the remote loader to your dummy file:
// webpack.config.js
const path = require('path');
const webpack = require('webpack');
module.exports = {
// ... other config options
resolve: {
alias: {
// Alias any imports containing loadAppleId to our local dummy file
loadAppleId: path.resolve(__dirname, 'src/loadAppleId.js'),
},
},
plugins: [
// ... other plugins
// Add a plugin to replace any direct references to the Apple ID script URL
new webpack.NormalModuleReplacementPlugin(
/loadAppleId/,
path.resolve(__dirname, 'src/loadAppleId.js')
),
],
};
For a complete Webpack implementation example, check out our Webpack reference implementation.