[Pas2js] about API Offline javascript

Pedro Pablo Oviedo Vera verakuba13 at gmail.com
Mon Oct 21 23:55:21 CEST 2019


you're right....I'm on it now! Thanks a lot!

El vie., 18 de octubre de 2019 5:26 p.m., Michael Van Canneyt <
michael at freepascal.org> escribió:

>
>
> On Fri, 18 Oct 2019, Pedro Pablo Oviedo Vera wrote:
>
> > I'm try learn about APIOffline and I need applicationCache method from
> > window class....but it has not that....so I written something as a draft
> > ....I'm not sure....:-(...:here  I go:
> >
> > (* in order to give support to method window.applicationOffline *)
> > TJSnsrefcnt                   = integer;
> > TJSnsISupports                = class;
> > TJSnsIDOMOfflineResourcesList = class;
> >
> > TJSnsIDOMEventListenerEvent = TJSEvent;
> >
> > TJSnsIDOMEventListener    = reference to function(aEvent:
> > TJSnsIDOMEventListenerEvent):Boolean;
> > TJSnsVoidIDOMEventHandler = reference to procedure(aUrl: TJSDOMString);
> >
> > TJSnsIDOMOfflineResourcesList = class external name
> > 'nsIDOMOfflineResourcesList'(TJSnsISupport)
> > private
> > fmozItems      : TJSnsIDOMOfflineResourseList; external name 'mozItems';
> > fmozLength     : longint; external name 'mozLength';
> > fonerror       : TJSnsIDOMEventListener; external name 'onerror';
> > fonnoupdate    : TJSnsIDOMEventListener; external name 'onnoupdate';
> > fonprogress    : TJSnsIDOMEventListener; external name 'onprogress';
> > fonupdateready : TJSnsIDOMEventListener; external name 'onupdateready';
> > foncached      : TJSnsIDOMEventListener; external name 'oncached';
> > fstatus        : word;  external name 'status';
> > public
> > const
> >  UNCACHED    = 0;
> >  IDLE        = 1;
> >  CHECKIG     = 2;
> >  DOWNLOADING = 3;
> >  UPDATEREADY = 4;
> >  OBSOLETE    = 5;
> > public
> > procedure addEventListener(aname : string; aListener :
> > TJSnsIDOMEventHandler);
> > procedure addEventListener(aname : string; aListener :
> TJSRawEventHandler);
> >
> > function mozHasItem(aUrl: TJSDOMString): Boolean;
> > function mozItem(aIndex: longint): TJSDOMString;
> > procedure mozaAdd(aUrl: TJSDOMString);
> > procedure mozRemove(aUrl: TJSDOMString);
> > procedure swapCache;
> > procedure update;
> >
> > property mozItems  : TJSnsIDOMOfflineResourseList read fmozItems;
> > property mozLength : word  read fmozLength ;
> > property status    : word  read fstatus;
> >
> > end;
> >
> > TJSnsISupports = class external name 'nsISupport'
> > public
> >  function AddRef: TJSnsrefcnt; ??
> >  procedure QueryInterface(aUuid: TJSnsIIDRef?; aParams: array of
> JSValue);
> >  function Release: TJSnsrefcnt;
> > end;
> >
> > (* in window class .....*)
> > function applicationCache: TJSnsIDOMOfflineResourceList;
> >
> > .......question is......is it ok?
>
> It looks correct, but this API is deprecated.
> You should use service workers instead.
>
> Michael.
> _______________________________________________
> Pas2js maillist  -  Pas2js at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/pas2js/attachments/20191021/61b66e0a/attachment.html>


More information about the Pas2js mailing list