Giter Club home page Giter Club logo

node-iframe-replacement's Issues

PHP?

Would something like this be possible with PHP instead of node? I hate relying on iFrames for my apps. :)

Add routes ?

Hello,

Thanks you for this code, it is really nice.

I have a header that I want to hide on all the pages of a website for example "https://www.website.com". I can do it with you code for the homepage.
I would like server.js to reroute the links within the app so it still hides the header on "https://www.website.com/about">
Do you think there is a way to do that ? Do you know how I could hide the header on all the pages ?

Regards,

How to render a page with in a specified element ?

First of all, this is a very nice node iframe replacement. Is it possible to render the particular web page lets say bbc.com inside any element? For instant,

 <div or iframe src="parsed.html">
       Content for [bbc.com](http://www.bbc.com/http://www.bbc.com/) 
 </iframe>

So that, the exact need of iframe can be replaced ? Please find the attachment for the details.
screen shot 2017-11-04 at 12 14 51 pm

iframes

The other day I was trying to make an iframe for this link for an affiliate program (http://freebitco.in/?r=9171729&tag=wonderland), and I did a test page (http://wonderlandcoin.com/bitcoin/2.php) and the test uses the Example Domain (example.com) and that works, but when I put in the real URL above, the result is a blank page (http://wonderlandcoin.com/bitcoin/) My question is, did they block the ability for anyone to display their site in an iframe? If so, would your thing help me at all?

showing error

C:\Users\ADMIN\myapp\node_modules\node-iframe-replacement\example>node server.js
Server running... Visit http://localhost:8080 in your browser
C:\Users\ADMIN\myapp\node_modules\cheerio\lib\parse.js:55
var oldParent = node.parent || node.root,
^

TypeError: Cannot read property 'parent' of undefined
at Function.exports.update (C:\Users\ADMIN\myapp\node_modules\cheerio\lib\parse.js:55:26)
at module.exports (C:\Users\ADMIN\myapp\node_modules\cheerio\lib\parse.js:17:11)
at Function.exports.load (C:\Users\ADMIN\myapp\node_modules\cheerio\lib\static.js:19:14)
at C:\Users\ADMIN\myapp\node_modules\node-iframe-replacement\lib\node-iframe-replacement.js:37:41
at Immediate. (C:\Users\ADMIN\myapp\node_modules\express-handlebars\lib\utils.js:18:13)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)

Implementation with next.js?

const express = require('express')
const next = require('next')

const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })
const handle = app.getRequestHandler()
var iframeReplacement = require('./lib/node-iframe-replacement.js');

app.prepare()
.then(() => {
  const server = express()
  app.use(iframeReplacement);

  server.get('/a', (req, res) => {
    return app.render(req, res, '/b', req.query)
  })

  server.get('/b', (req, res) => {
    return app.render(req, res, '/a', req.query)
  })

  server.get('*', (req, res) => {
    return handle(req, res)
  })

  server.get('/bbc', function(req, res) {
    return handle(res.merge('fake-news', {
          sourceUrl: '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
      });
  }));

  server.listen(3000, (err) => {
    if (err) throw err
    console.log('> Ready on http://localhost:3000')
  })
})

A page gets rendered at pages/bbc.js that includes a react component with title BBC.
Any ideas on how to get these two projects integrated?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.