Installations
npm install frame-observer
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
18.16.0
NPM Version
9.5.1
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (98.91%)
HTML (1.09%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
eHanlin
Download Statistics
Total Downloads
13,162
Last Day
1
Last Week
1
Last Month
32
Last Year
2,146
GitHub Statistics
6 Stars
92 Commits
1 Forks
12 Watching
1 Branches
4 Contributors
Package Meta Information
Latest Version
1.3.0
Package Id
frame-observer@1.3.0
Unpacked Size
33.96 MB
Size
8.45 MB
File Count
8,376
NPM Version
9.5.1
Node Version
18.16.0
Publised On
29 Mar 2024
Total Downloads
Cumulative downloads
Total Downloads
13,162
Last day
0%
1
Compared to previous day
Last week
-88.9%
1
Compared to previous week
Last month
-61.4%
32
Compared to previous month
Last year
93%
2,146
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
25
frame observer
This is iframe observer. Be Able to use it when you need get frame states or event listeners.
You need to add polyfill script if your browser is not support es6.
Install
1bower install frame-observer
Install node modules
1npm install frame-observer
Usage
index.html
1var iframe = document.querySelector('iframe'); 2var promise = frameObserver.callMethod( iframe, "info", {a:3} ); 3 4promise.then(function(){ 5 console.log( arguments ); 6});
frame.html
1frameObserver.registerMethods({ 2 3 info:function( promise ){ 4 promise.resolve(1); 5 } 6});
API
frameObserver
readyState( iframe, stateName ):Promise
listen a state from frame, promise will be trigger when state is resolved or rejected.
1var iframe = document.querySelector('iframe'); 2 3frameObserver 4.readyState( iframe, 'ready' ) 5.then(function(){ 6 console.log('ready state:done...'); 7},function(){ 8 console.log('ready state:fail...'); 9});
resolveState( stateName, params... )
trigger a state for resolve.
1frameObserver.resolveState('ready');
rejectState( stateName, params... )
trigger a state for reject.
1frameObserver.rejectState('ready');
on( iframe, eventName, func )
listen a event from frame.
1var iframe = document.querySelector('iframe'); 2 3frameObserver.on( iframe, 'iframeClicked', function(){ 4 console.log('iframe clicked'); 5});
off( iframe, eventName, func )
unregister a event from frame.
1frameObserver.off( iframe, 'iframeClicked', iframeClicked );
registerMethods( methods )
implement some methods for other iframes. The method inputs will inject
promise
andparameters
.
1frameObserver.registerMethods({
2 hello:function(promise, parameter1, parameter2 ...){
3 console.log('hello by self');
4 }
5});
callMethod( iframe, methodName, params... ):Promise
call a method of iframe or parent.
1var promise = frameObserver.callMethod( iframe, "hello", {a:3} ); 2 3promise.then(function(){ 4 console.log( arguments ); 5});
trigger( name, params... )
trigger a event
1frameObserver.trigger( 'clicked' );
getContext(el):FrameObserverContext
get a el context
1frameObserver.getContext(iframe);
FrameObserverContext
on(eventName, func)
listen a event from context.
off(eventName, func)
unregister a event from context.
readyState(stateName):Promise
listen a state from context.
callMethod(methodName, params...):Promise
call a method of context.
getElement():HTMLElement
get a element from context.
Run Server
1npm run dev
Build minfy
1npm run build
Test
1npm run test
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE.txt:0
- Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0
Reason
Found 1/29 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 2 are checked with a SAST tool
Reason
65 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7
- Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx
- Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9
- Warn: Project is vulnerable to: GHSA-434g-2637-qmqr
- Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m
- Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw
- Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p
- Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747
- Warn: Project is vulnerable to: GHSA-j4f2-536g-r55m
- Warn: Project is vulnerable to: GHSA-r7qp-cfhv-p84w
- Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc
- Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx
- Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc
- Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp
- Warn: Project is vulnerable to: GHSA-qh2h-chj9-jffq
- Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-7x7c-qm48-pq9c
- Warn: Project is vulnerable to: GHSA-rc3x-jf5g-xvc5
- Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq
- Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695
- Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm
- Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574
- Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-82v2-mx6x-wq7q
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-w9mr-4mfr-499f
- Warn: Project is vulnerable to: GHSA-28xh-wpgr-7fm8
- Warn: Project is vulnerable to: GHSA-q75g-2496-mxpp
- Warn: Project is vulnerable to: GHSA-6fx8-h7jm-663j
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
- Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p
- Warn: Project is vulnerable to: GHSA-fxwf-4rqh-v8g3
- Warn: Project is vulnerable to: GHSA-25hc-qcg6-38wj
- Warn: Project is vulnerable to: GHSA-xfhh-g9f5-x4m4
- Warn: Project is vulnerable to: GHSA-qm95-pgcg-qqfq
- Warn: Project is vulnerable to: GHSA-cqmj-92xf-r6r9
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v
- Warn: Project is vulnerable to: GHSA-cf4h-3jhx-xvhq
- Warn: Project is vulnerable to: GHSA-mgfv-m47x-4wqp
- Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6
- Warn: Project is vulnerable to: GHSA-cf66-xwfp-gvc4
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-5v72-xg48-5rpm
- Warn: Project is vulnerable to: GHSA-72mh-269x-7mh5
- Warn: Project is vulnerable to: GHSA-h4j5-c7cj-74xg
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
1.7
/10
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to frame-observer
@v-act/vjs.framework.extension.platform.interface.observer
2018-08-13liangzc:添加observer时统一域处理
@v-act/vjs.framework.extension.platform.services.observer.manager
observer管理器模块
aframe-observer-component
An Observer component for a camera in an A-frame scene - Render to a canvas from A-frame camera
@bluframe/bluframe
A collection of React UI Components and Hooks by Blu Frame