小编pau*_*eno的帖子

是否可以在无头模式下使用扩展程序运行Google Chrome?

我无法使用无头模式在Google Chrome中使用我当前安装的扩展程序.有没有办法启用它们?

检查扩展是否有效的简单方法是添加,例如," Comic Sans Everything "扩展.

谷歌看起来像这样:

谷歌看起来很漂亮

但是,如果我使用无头模式(google-chrome --headless --disable-gpu --screenshot https://www.google.com)拍摄页面的屏幕截图,结果是:

谷歌处于无头模式

google-chrome google-chrome-extension google-chrome-headless

36
推荐指数
5
解决办法
2万
查看次数

在配置$ routeProvider时是否可以从$ templateCache获取模板?

我的目的是通过一次调用外部JSON文件来加载我的Web应用程序的所有模板,该文件包含所有模板名称和值的列表.

我目前正在我的应用程序的运行阶段加载这些模板:

app.run(function ($http, $templateCache) {
    $http.get('/templates/all.json').success(function (data) {
        var i;
        for (i = 0; i < data.length; i++) {
            $templateCache.put(data[i].name, data[i].template);
        }
    });
});
Run Code Online (Sandbox Code Playgroud)

但是,Angular.js配置阶段在运行阶段之前执行,所以当我打算从templateCache加载时:

app.config(function($routeProvider, $locationProvider) {
    //App routing
    $routeProvider.
        //Homepage
        when('/', {templateUrl: 'home.html'}).

        //My schedule
        when('/my-schedule', {templateUrl: 'my-schedule.html'});
});
Run Code Online (Sandbox Code Playgroud)

Angular尝试home.html从服务器加载,因为$templateCache尚未填充.

假设all.json包含用于home.htmlmy-schedule.html流行示例的模板.

$templateCache在配置应用程序之前是否可以填写$routeProvider

configuration angularjs

13
推荐指数
1
解决办法
1万
查看次数

位置特征检测:固定

我试图找到一个脚本,检测设备是否position: fixed相对于ViewPort而不是整个文档放置元素.

目前,标准桌面浏览器和Mobile Safari(适用于iOS 5)这样做,而Android设备将固定元素相对于整个文档放置.

我找到了几个测试来检测这个,但似乎没有一个工作:

有谁知道在哪里找到/如何编写实际检测到的测试?我不想依赖浏览器嗅探.

javascript mobile feature-detection

8
推荐指数
2
解决办法
4063
查看次数

通过电子邮件发送WhatsApp聊天时,如何让我的Android应用程序出现在应用选择器中?

当我使用WhatsApp中的"电子邮件会话"功能时,我有兴趣让我的应用程序显示在显示的应用程序列表中.

在使用"电子邮件对话"WhatsApp功能登录手机时,我可以看到SEND_MULTIPLEGmail收到的意图:

I/ActivityManager(  859): START u0 {act=android.intent.action.SEND_MULTIPLE typ=text/* flg=0xb080001 pkg=com.google.android.gm cmp=com.google.android.gm/.ComposeActivityGmail (has clip) (has extras)} from uid 10114 on display 0
Run Code Online (Sandbox Code Playgroud)

所以我想我需要为SEND_MULTIPLE我的应用清单中的操作添加一个intent过滤器.

目前我AndroidManifest.xml是:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="co.xxx.xxx" >


<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme" >


    <activity
        android:name=".MyActivity"
        android:label="@string/app_name"
        android:theme="@style/AppTheme.NoActionBar" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>


        <intent-filter>
            <action android:name="android.intent.action.SENDTO" />

            <data android:scheme="mailto" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>

        <intent-filter>
            <action android:name="android.intent.action.VIEW" />

            <data android:scheme="mailto" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" /> …
Run Code Online (Sandbox Code Playgroud)

email android android-intent whatsapp

6
推荐指数
1
解决办法
1005
查看次数