Comments (4)
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.
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.
- Modify privly.js's resize code to accept serialized JSON content. See JSON.stringify and JSON.parse().
- Modify host_page_integration.js to send JSON instead of the current CSV format.
- 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.
- Add functions to the host_page_integration.js script for
showInjectedIframe
anddestroyInjectedIframe
. These will both use the new JSON message format to tell the privly.js file to take the requested action. - Modify the privly.js file to take the requested action after examining the JSON message.
- Add unit test coverage.
- Add Selenium test coverage.
from privly-chrome.
@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.
@smcgregor Nevermind. @irdan helped me. It's sorted out.
from privly-chrome.
Related Issues (20)
- Privly icon scrolls with window HOT 1
- Privly Button doesn't work with TinyMCE HOT 17
- no file as chromeOptions.html HOT 4
- Privly posting doesn't work with Youtube comment HOT 10
- Only Automatically Close Posting Window if Pasting Successful HOT 3
- Iframes don't get resized
- Privly should not try to process URLs inside editable iframe HOT 2
- Change run_at property of privly.js? HOT 3
- Merge gsoc-develop to develop HOT 6
- Right click menu does not launch new message in google chat
- Implement proper rate limiting for iframe injection
- Erratic behavior on Facebook chat box HOT 4
- Broken Build HOT 1
- Fix CodeClimate Issues HOT 1
- Add Continuous Integration System to Forks
- Draw Attention to Extension Popup Icon on Installation HOT 6
- Remove LocalStorage on Uninstall HOT 5
- Use the chrome.runtime api onInstalled event to launch the firstrun page HOT 4
- Privly button weird behaiour HOT 1
- Add Integration Test for Injection Parameters
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from privly-chrome.