Code Monkey home page Code Monkey logo

Comments (4)

smcgregor avatar smcgregor commented on August 20, 2024

I think the proper way to do this is to allow the injected iframe to ask the content script that injected it to:

  • Show the injected iframe (hide the link original link)
  • Destroy the injected iframe (remove the iframe from the DOM and show the original link)

To maintain consistency with how it is currently implemented, all links should temporarily show themselves while they are loading, but the injected iframe could then choose to destroy itself if it doesn't get a good status from the server or fails to decrypt.

from privly-chrome.

smcgregor avatar smcgregor commented on August 20, 2024

Doing this properly will take a few implementation steps, the most challenging of which is figuring out how to get messages from the iframe to the content script. Since we already send a resize message to the content script, you should look at where the privly.js file sends and receives resize messages.

  1. Modify privly.js's resize code to accept serialized JSON content. See JSON.stringify and JSON.parse().
  2. Modify host_page_integration.js to send JSON instead of the current CSV format.
  3. Change the resize command to be in JSON format with {privly:{resize:10}} could represent a command to the privly.js script to resize the iframe to 10 pixels.
  4. Add functions to the host_page_integration.js script for showInjectedIframe and destroyInjectedIframe. These will both use the new JSON message format to tell the privly.js file to take the requested action.
  5. Modify the privly.js file to take the requested action after examining the JSON message.
  6. Add unit test coverage.
  7. Add Selenium test coverage.

from privly-chrome.

bhavul avatar bhavul commented on August 20, 2024

@smcgregor quick question. In the point #3 above {privly:{resize:10}} should represent the script to resize the iframe to 10px. is 'privly' the name of the iframe? I'm trying for {frameId : {resize:height}}
But, after JSON stringify it gets converted to {"frameId" : {"resize" : 41}} instead of {ifrm0 : {"resize" : 41}}

from privly-chrome.

bhavul avatar bhavul commented on August 20, 2024

@smcgregor Nevermind. @irdan helped me. It's sorted out.

from privly-chrome.

Related Issues (20)

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.