Local Chrome extension for setting file input type = "file"

I am creating an extension for the Chrome browser. I do not want to select a file from the input type="file"html element using the extension. But I know that this is not possible due to security restrictions.

Is there a way to remove Chrome's security restrictions associated with this issue so that it is possible.

Thank.

+5
source share
3 answers

OK, I'm going to answer my own question.

First of all, thanks to Michael Dibbets for your answers as well. --disable-web-security and --allow-file-access-from-filesdoes not work. I did not go to my native plugins and expanded the chrome from its source, since it seems to take time.

Decision:

chromedriver selenium java .

Slanec , .

java:

System.setProperty("webdriver.chrome.driver", "C:/.../chromedriver.exe");

WebDriver driver = new ChromeDriver();
driver.get("URL_OF_THE_PAGE");
WebElement link = driver.findElement(By.linkText("TEXT_IN_THE_LINK"));
link.click();
WebElement choose_file_input = driver.findElement(By.className("CLASS_OF_THE_INPUT"));
choose_file_input.sendKeys("PATH_TO_FILE");

!

+4

? , --disable-web-security -allow-file-access-from-files. : https://code.google.com/p/firebreath/

+1

.

Security restrictions exist for a specific purpose and cannot be excluded (not so easily). The goal is that the user can download the extension from the Google Play store and not worry about what risk he will put on his system.

0
source

All Articles