小编Mor*_*ta1的帖子

允许Chrome 61中的Flash内容通过chromedriver运行

我一直在使用它来允许闪存换铬版69.

ChromeOptions options = new ChromeOptions();
// disable ephemeral flash permissions flag
options.addArguments("--disable-features=EnableEphemeralFlashPermission");
Map<String, Object> prefs = new HashMap<>();
// Enable flash for all sites for Chrome 69
prefs.put("profile.content_settings.exceptions.plugins.*,*.setting", 1);

options.setExperimentalOption("prefs", prefs);
nestedDriver = new ChromeDriver(options);
Run Code Online (Sandbox Code Playgroud)

现在在版本71的chrome上,此实验性功能(EphemeralFlashPermission)已被删除.

我也试过使用这些设置,但它没有用.

prefs.put("profile.default_content_setting_values.plugins", 1);
prefs.put("profile.content_settings.plugin_whitelist.adobe-flash-player", 1);
prefs.put("profile.content_settings.exceptions.plugins.*,*.per_resource.adobe-flash-player", 1);
Run Code Online (Sandbox Code Playgroud)

现在有没有其他方法可以使用chromedriver启用闪存?

flash google-chrome selenium-chromedriver

3
推荐指数
1
解决办法
7138
查看次数

为什么gets()假设extern在C中的代码中返回int?

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main() {
    int length;
    char **lines, buffer[80];

    printf("How many lines do you want to enter?.\n");
    scanf("%d", &length);
    getchar();
    lines = (char**)malloc(length * sizeof(char*));
    for (i = 0; i < length; ++i) { //Scan user's lines
        gets(buffer);
        lines[i] = (char*)malloc(strlen(buffer) * sizeof(char) + 1);
        if (!lines[i]) { //Check if allocation available
            printf("Error! Out of memory!");
            return endProgram;
        }
        strcpy(lines[i], buffer);
    }
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

我想知道为什么gets()函数给我一个关于假设extern返回int的错误,我只是想扫描一个字符串.

c gets

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

在C中使用数组时出错

int main() //task 10
{
    int num[9], i, counter = 0, minNum, maxNum = 0, sum = 0;
    for (i = 0; i <= 9; ++i)
    {
        scanf("%d", &num[i]);
        if (num[i] > maxNum)
        {
            maxNum = num[i];
            minNum = maxNum;
        }
        else if (num[i] < minNum)
            minNum = num[i];
        sum += num[i];
    }
    printf("minNum: %d, maxNum: %d\nThe average is:%d\n", minNum, maxNum, sum / 10);
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

在尝试运行此程序时,我收到此错误:运行时检查失败#2 - 变量'num'周围的堆栈已损坏.我想知道我的阵列有什么问题.

c arrays

-1
推荐指数
1
解决办法
65
查看次数

标签 统计

c ×2

arrays ×1

flash ×1

gets ×1

google-chrome ×1

selenium-chromedriver ×1