我的扩展应该加载一个内容脚本searchTopic.js,只有在它注入的页面已经完全加载之后(是的,我已经在扩展清单中将"run_at"设置为"document_end"),但实际上它在加载之前已经创建了所有DOM对象(关键的对象是通过页面中的一些Javascript创建的).所以,问题是,我怎么能等到页面的Javascript执行完毕?这是我的清单:
"content_scripts": [
{
"run_at": "document_end",
"matches": ["https://groups.google.com/forum/*"],
"js": ["searchTopic.js"]
}
],
Run Code Online (Sandbox Code Playgroud) 我有一台运行 Android 11 的 Oppo A53。当我在初始活动(登录页面)中设置断点时,一旦命中断点,应用程序将在不活动五秒后终止。在模拟设备或我的其他测试设备(同样运行 Android 11 的 Samsung Tab A)上不会出现此问题。此外,一旦应用程序启动另一个 Activity,我就可以无限期地停留在新 Activity 的断点上。
以下是应用程序清单的一部分,显示了登录活动的定义:
<activity
android:name=".LoginActivity"
android:theme="@style/SplashTheme"
android:screenOrientation="locked"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
这是 logcat 中的相关行:
2022-02-09 16:12:38.811 11786-11786/com.uomini.meecha D/OplusInputMethodUtil: init DEBUG to false, update DEBUG_IME to false
2022-02-09 16:12:39.381 11786-12103/com.uomini.meecha V/FA: Connection attempt already in progress
2022-02-09 16:12:44.018 11786-11800/com.uomini.meecha I/m.uomini.meech: Thread[2,tid=11800,WaitingInMainSignalCatcherLoop,Thread*=0xb4000079bc426000,peer=0x12ec0000,"Signal Catcher"]: reacting to signal 3
2022-02-09 16:12:44.018 11786-11800/com.uomini.meecha I/m.uomini.meech:
2022-02-09 16:12:44.190 11786-11800/com.uomini.meecha I/m.uomini.meech: Wrote stack traces to tombstoned
Run Code Online (Sandbox Code Playgroud)
我的其他应用程序上也发生同样的情况,所以我不认为这是应用程序问题,特别是因为它只发生在 Oppo 上。
我正在尝试按照本页上的说明实现无需密码的电子邮件登录,当收件人选择登录消息中的链接时,他们会看到以下消息:
我不明白这一点。域 pento-2a27b.firebaseapp.com 已列入白名单,因为它已包含在授权域列表中:
动态链接也是如此:
那么 Firebase 抱怨什么呢?我尝试发送带有和不带有路径组件“signintoapp”的链接,并得到了相同的结果。
顺便说一句,我的代码的相关部分如下所示:
final ActionCodeSettings actionCodeSettings =
ActionCodeSettings.newBuilder()
// URL you want to redirect back to. The domain (www.example.com) for this
// URL must be whitelisted in the Firebase Console.
.setUrl("https://pento-2a27b.firebaseapp.com")
// This must be true
.setHandleCodeInApp(true)
.setAndroidPackageName(
"com.chiaramail.pento",
true, /* installIfNotAvailable */
"140" /* minimumVersion */)
.build();
Run Code Online (Sandbox Code Playgroud)
和
alertContinue.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mAuth.sendSignInLinkToEmail(emailAddress.getText().toString(), actionCodeSettings)
.addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) { …
Run Code Online (Sandbox Code Playgroud) email firebase firebase-authentication firebase-dynamic-links
当我的应用程序尝试膨胀包含 ImageView 的布局时,它在运行 Android 7.1.2 的 x86 的 Trend TaintArt 上失败。崩溃报告 Drawable 不存在:
然而,Drawable (ic_list_white) 是存在的:
奇怪的是,这似乎是唯一有问题的设备。有没有人遇到过这个问题?
android android-inflate android-imageview inflate-exception firebase-crash-reporting
我正在设置我的 Android 应用程序以支持电子邮件身份验证,作为任务的一部分,我需要创建动态链接,这是我在 Firebase 控制台中完成的。但是,当我测试链接(https://chiaramail.page.link/.well-known/assetlinks.json )时,我刚刚返回空数据(“[]”)。是否还需要发生其他事情?
使用开发人员工具查看扩展程序时,仅看到生成的背景文件background.js;我的内容脚本没有出现在“内容脚本”标签下。有什么想法吗?清单的相关部分如下所示:
"content_scripts": [{
"run_at": "document_end",
"js": ["postMsg.js"],
"matches": ["https://groups.google.com/forum/*"]
}],
Run Code Online (Sandbox Code Playgroud)
postMsg.js被注入到页面中,但是从未出现在开发者工具窗口中,因此我无法对其进行调试。
debugging developer-tools google-chrome-extension content-script
我用我的Android和iOS应用火力地堡的动态链接,虽然我没有问题,保存链接,当我尝试通过选择“打开您的iOS应用的深层链接”来定义适用于iOS的链接行为,然后按下一步和编辑链接,选择不会被保存:
有没有人遇到过这个问题?除了链接行为之外,其他所有内容都会在动态链接中更新。
我编写了一个前台服务,以确保我的应用程序在进入后台时可以继续运行。该应用程序需要在后台运行,因为在其计时器结束后,它会发出提示音并振动以提醒用户。但是,当按下电源或主页按钮时,除非手机接通电源,否则应用程序的计时器会在大约 15 分钟后停止运行。当我测试时,手机已充满电。
顺便说一句,在阅读了确保应用程序继续运行的各种网站后,我还将应用程序设置为不针对电池寿命进行优化。从我阅读的所有内容来看,我所做的一切都是正确的,但我仍然无法让它发挥作用。我在 Pixel 2 上运行 Android 11。我知道 Google 限制了更高版本 Android 的前台处理,但是将应用程序设置为不优化电池寿命应该可以解决这个问题,不是吗?为安全起见,当应用程序启动时,它会要求用户批准后台操作:
PowerManager pm = (PowerManager)getSystemService(POWER_SERVICE);
if (!pm.isIgnoringBatteryOptimizations(APPLICATION_ID)) {
// Ask user to allow app to not optimize battery life. This will keep
// the app running when the user puts it in the background by pressing
// the Power or Home button.
Intent intent = new Intent();
intent.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
intent.setData(Uri.parse("package:" + APPLICATION_ID));
startActivity(intent);
}
Run Code Online (Sandbox Code Playgroud)
因此,当应用程序运行并针对电池进行优化时,用户会看到以下内容:
我启动前台服务如下:
private void startForegroundMonitoring() {
broadcastIntent = new Intent(context, BroadcastService.class);
broadcastIntent.putExtra(ALLOWEDTIME, allowed_time);
broadcastIntent.putExtra(BEEP, beep.isChecked()); …
Run Code Online (Sandbox Code Playgroud) 我正在尝试将无密码电子邮件登录添加到我的 Firebase 应用程序,所以我做的第一件事就是将我的域列入白名单:
接下来,我尝试创建动态链接:
此时,当我按下“创建”按钮时,出现错误。有人看到我做错了什么吗?
我还尝试了此视频中建议的内容,结果相同。
最后一件事,然后我已经没有想法了:在 Chrome 开发人员控制台中,我看到 Create 失败并显示错误 400,这表明我需要更新列入白名单的 URL。我通过添加以下 URL 来做到这一点:
这个问题一直让我发疯。我已经尝试了一切,我想。让我想知道是否需要在 Firebase 中重新创建我的应用程序。
email whitelist firebase-authentication firebase-dynamic-links
我正在升级我前段时间构建的游戏用户界面,并正在向Google的Material Design迈进.作为代码升级的一部分,我将向后兼容性支持库android-support-v7-appcompat安装到我的Eclipse项目中,并将主要活动扩展到AppCompatActivity,如下所示:
public class FivetoGo extends AppCompatActivity {
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(mToolbar);
.
.
.
Run Code Online (Sandbox Code Playgroud)
但是当我调用setSupportActionBar()时,我得到了上面的错误.这是main.xml:
<?xml version='1.0' encoding='UTF-8' ?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<android.support.v7.widget.Toolbar
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ff6d7fe2"
android:minHeight="?android:attr/actionBarSize"
app:contentInsetEnd="0dp"
app:contentInsetStart="0dp" >
</android.support.v7.widget.Toolbar>
<Button android:id="@+id/intro_button"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:text="@string/rules"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/secret_word_label"
android:layout_below="@id/intro_button"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:textStyle="bold"
android:textSize="20sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/my_secret_word"/>
<EditText android:id="@+id/my_secret_word_text"
android:layout_below="@id/intro_button"
android:layout_toRightOf="@id/secret_word_label"
android:layout_alignBaseline="@id/secret_word_label"
android:inputType="textNoSuggestions"
android:capitalize="none"
android:maxLength="5"
android:textSize="20sp"
android:layout_width="100dp"
android:layout_height="wrap_content"/>
<Button android:id="@+id/done_button_main" …
Run Code Online (Sandbox Code Playgroud) android ×5
debugging ×2
email ×2
firebase ×2
ios ×1
java ×1
javascript ×1
oppo ×1
termination ×1
whitelist ×1