Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
iframe-messenger
Advanced tools
postMessage interface allowing for the resizing of containing iframe and link navigation of the parent window.
http://interactive.guim.co.uk/libs/iframe-messenger/iframeMessenger.js
Include the library within your page or application via <script>
or require()
. Call a method. You'll probably want to call enableAutoResize().
Auto-resize example:
<script src="//interactive.guim.co.uk/libs/iframe-messenger/iframeMessenger.js"></script>
<script>
iframeMessenger.enableAutoResize();
</script>
Getting parent's URL hash fragment example:
<script src="//interactive.guim.co.uk/libs/iframe-messenger/iframeMessenger.js"></script>
<script>
function logParentHashFragment(locationObj) {
console.log(locationObj.hash);
}
iframeMessenger.getLocation(logParentHashFragment);
</script>
Send all links to parent window example:
<script src="//interactive.guim.co.uk/libs/iframe-messenger/iframeMessenger.js"></script>
<script>
var links = document.querySelectorAll('a');
for(var i = 0; i < links.length; i++) {
links[i].addEventListener('click', function(event) {
event.preventDefault();
iframeMessenger.navigate(this.href);
}, false);
}
</script>
Update iframe wrapper to match document height. Optional options (object) can be provided.
NOTE: absoluteHeight
checks the position of every element on the page, this has a significant
performance impact.
{
absoluteHeight: false // Check absolute height of every element, slow!
}
(optional) height
: INT or percentage eg '20%'
Specify a height for the iframe wrapper. If no height is specified the height
of the current document is sent.
Ask parent page for location information and executes callback passing
along an object containing parent's document.location
information.
Sample of returned location object:
{
hash: "#myhash",
host: "example.com:8080",
hostname: "exaple.com",
href: "http://example.com:8080/test.html?query=test#myhash",
origin: "http://example.com:8080",
pathname: "/test.html",
port: "8080",
protocol: "http:"
search: "?query=test",
type: "get-location" // for iframeMessenger usage
id: "iframeMessenger:ceprg" // for iframeMessenger usage
}
Navigate parent window to specified URL (string)
Sends request to scroll the parent page to a specified x, y position.
Ask parent page for position information and execute callback upon return post message.
Sample of returned position data object:
{
'iframeTop': 300, // iframe.getBoundingClientRect().top,
'innerHeight': 620, // window.innerHeight,
'innerWidth': 960, // window.innerWidth,
'pageYOffset': 90 // window.pageYOffset
}
0.2.7
0.2.6
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1:
absoluteHeight
option to auto-resize to handle absolute absolute positioned elements0.2.0:
0.1.0:
FAQs
iframe messenger
We found that iframe-messenger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.