ServiceWorker.lpr 971 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. program ServiceWorker;
  2. {$mode objfpc}
  3. uses
  4. SysUtils, Classes, ServiceWorkerApp;
  5. const
  6. YourCacheName = 'v7'; // usually increased with every version
  7. // The cache is specific to your domain, so no need to include your app name.
  8. type
  9. { TApplication }
  10. TApplication = class(TServiceWorkerApplication)
  11. public
  12. constructor Create(AOwner: TComponent); override;
  13. end;
  14. { TApplication }
  15. constructor TApplication.Create(AOwner: TComponent);
  16. begin
  17. inherited Create(AOwner);
  18. FCacheName:=YourCacheName;
  19. FResources:=[
  20. '/index.html',
  21. '/css/style.css',
  22. '/SimplePWA1.js',
  23. '/images/Alpha.png',
  24. '/images/Beta.png',
  25. '/images/Gamma.png',
  26. '/images/Delta.png',
  27. '/images/Epsilon.png',
  28. '/images/Zeta.png',
  29. '/images/Eta.png',
  30. '/images/Theta.png',
  31. '/images/Iota.png',
  32. '/images/error.png' ];
  33. FallbackURL := '/images/error.png';
  34. end;
  35. var
  36. App: TApplication;
  37. begin
  38. App:=TApplication.Create(nil);
  39. App.Run;
  40. end.