Skip to content

Commit

Permalink
added chrome as a default user agent
Browse files Browse the repository at this point in the history
  • Loading branch information
John Doherty committed Jan 13, 2017
1 parent 389a811 commit ae47d2f
Show file tree
Hide file tree
Showing 16 changed files with 11 additions and 3 deletions.
Empty file modified .eslintignore
100644 → 100755
Empty file.
Empty file modified .eslintrc
100644 → 100755
Empty file.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions README.MD
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ To ensure the source scripts, styles and images load within your site a base tag
Because of this, you need to ensure all the links within your conent are absolute.

## Contributing

Everyone is very welcome to contribute to this project. You can contribute just by submitting bugs or suggesting improvements by [opening an issue on GitHub](https://github.com/john-doherty/node-iframe-replacement/issues).

## History
Expand Down
Empty file modified docs/bbc-news-actual-homepage.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/bbc-news-fake-homepage.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion example/server.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function Server() {

// respond to this request with our fake-new content embedded within the BBC News home page
res.merge('fake-news', {
sourceUrl: 'http://www.bbc.co.uk/news', // external url to fetch
sourceUrl: 'https://www.facebook.com', //http://www.bbc.co.uk/news', // external url to fetch
sourcePlaceholder: 'div[data-entityid="container-top-stories#1"]' // css selector to inject our content into
});
});
Expand Down
Empty file modified example/views/fake-news.hbs
100644 → 100755
Empty file.
Empty file modified index.js
100644 → 100755
Empty file.
9 changes: 8 additions & 1 deletion lib/node-iframe-replacement.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,15 @@ function resolveTemplate(sourceUrl) {
}
else if (isUrl(sourceUrl)) {

var params = {
uri: sourceUrl,
headers: {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36'
}
};

// request the source url
return request({ uri: sourceUrl }).then(function(html){
return request(params).then(function(html) {

// convert html into jquery style object so we can use selectors
var $ = cheerio.load(html);
Expand Down
2 changes: 1 addition & 1 deletion package.json
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-iframe-replacement",
"version": "0.0.7",
"version": "0.0.8",
"description": "NodeJS + Express replacement for the HTML iframe",
"main": "index.js",
"scripts": {
Expand Down
Empty file modified shippable.yml
100644 → 100755
Empty file.
Empty file modified test/data/external.html
100644 → 100755
Empty file.
Empty file modified test/intergration.spec.js
100644 → 100755
Empty file.
Empty file modified test/views/test-view.hbs
100644 → 100755
Empty file.

0 comments on commit ae47d2f

Please sign in to comment.