Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Commit 36094cd

Browse files
committed
formatted: readme
1 parent 1e1d053 commit 36094cd

File tree

1 file changed

+33
-19
lines changed

1 file changed

+33
-19
lines changed

README.md

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,22 @@ npm install selenium-webdriver @requestly/selenium
1616
require("chromedriver");
1717
const { Builder } = require("selenium-webdriver");
1818
const chrome = require("selenium-webdriver/chrome");
19-
const { getRequestlyExtension, importRequestlySharedList } = require("@requestly/selenium");
19+
const {
20+
getRequestlyExtension,
21+
importRequestlySharedList,
22+
} = require("@requestly/selenium");
2023

21-
const options = new chrome.Options().addExtensions(getRequestlyExtension("chrome"));
24+
const options = new chrome.Options().addExtensions(
25+
getRequestlyExtension("chrome")
26+
);
2227

2328
const driver = new Builder()
24-
.forBrowser("chrome")
25-
.setChromeOptions(options)
26-
.build();
27-
28-
importRequestlySharedList(driver, <sharedList_URL>); // Imports Rules in Selenium using Requestly sharedList feature
29+
.forBrowser("chrome")
30+
.setChromeOptions(options)
31+
.build();
2932

33+
// Imports Rules in Selenium using Requestly sharedList feature
34+
importRequestlySharedList(driver, <sharedList_URL>);
3035
```
3136

3237
> `chromedriver` is an npm wrapper for selenium ChromeDriver.
@@ -46,8 +51,8 @@ const driver = new Builder()
4651
.setFirefoxOptions(options)
4752
.build();
4853

49-
importRequestlySharedList(driver, <sharedList_URL>); // Imports Rules in Selenium using Requestly sharedList feature
50-
54+
// Imports Rules in Selenium using Requestly sharedList feature
55+
importRequestlySharedList(driver, <sharedList_URL>);
5156
```
5257

5358
> `geckodriver` is an npm wrapper for selenium firefox.
@@ -67,7 +72,8 @@ var driver = new webdriver.Builder()
6772
.setEdgeOptions(options)
6873
.build();
6974

70-
importRequestlySharedList(driver, <sharedList_URL>); // Imports Rules in Selenium using Requestly sharedList feature
75+
// Imports Rules in Selenium using Requestly sharedList feature
76+
importRequestlySharedList(driver, <sharedList_URL>);
7177

7278
```
7379

@@ -88,22 +94,30 @@ You can try this sharedlist to open websites in iframe:
8894
require("chromedriver");
8995
const { Builder } = require("selenium-webdriver");
9096
const chrome = require("selenium-webdriver/chrome");
91-
const { getRequestlyExtension, importRequestlySharedList } = require("@requestly/selenium");
97+
const {
98+
getRequestlyExtension,
99+
importRequestlySharedList,
100+
} = require("@requestly/selenium");
92101

93-
const options = new chrome.Options().addExtensions(getRequestlyExtension("chrome"));
102+
const options = new chrome.Options().addExtensions(
103+
getRequestlyExtension("chrome")
104+
);
94105

95106
const driver = new Builder()
96-
.forBrowser("chrome")
97-
.setChromeOptions(options)
98-
.build();
99-
100-
importRequestlySharedList(driver,"https://app.requestly.io/rules/#sharedList/1628536158787-Open-Websites-in-iframe"); // Imports Rule to load linkedin in iframe
107+
.forBrowser("chrome")
108+
.setChromeOptions(options)
109+
.build();
101110

102-
driver.get("https://jsbin.com/zotofulofu/2/edit?html,output"); // Opens a jsbin which loads linkedin in iframe
111+
// Imports Rule to load linkedin in iframe
112+
importRequestlySharedList(
113+
driver,
114+
"https://app.requestly.io/rules/#sharedList/1628536158787-Open-Websites-in-iframe"
115+
);
103116

117+
// Opens a jsbin which loads linkedin in iframe
118+
driver.get("https://jsbin.com/zotofulofu/2/edit?html,output");
104119
```
105120

106121
> Try opening the above `jsbin` without the `importRequestlySharedList` step. Did `linkedin` load in `iframe` without that step?
107122
108-
109123
Find more information [here](https://requestly.io/blog/2018/06/14/share-rules-with-other-users/)

0 commit comments

Comments
 (0)