Convert Figma logo to code with AI

liquidx logowebviewscreensaver

Mac OS X Screen Saver powered by a Web View

1,169
138
1,169
2

Top Related Projects

9,432

Open source Markdown editor for macOS.

Useful resources for creating apps with Electron

Clone to try a simple Electron app

Make any web page a desktop application

Quick Overview

WebViewScreenSaver is a macOS screen saver that allows users to display web content as their screen saver. It enables the use of custom HTML, CSS, and JavaScript to create dynamic and interactive screen savers, or simply display web pages as screen savers.

Pros

  • Allows for highly customizable screen savers using web technologies
  • Supports both local HTML files and remote web URLs
  • Provides options for configuring refresh intervals and JavaScript execution
  • Compatible with multiple macOS versions

Cons

  • Limited to macOS platform
  • Requires some web development knowledge for custom screen savers
  • May consume more system resources compared to traditional screen savers
  • Potential security concerns when loading external web content

Getting Started

  1. Download the latest release from the GitHub repository.
  2. Open the downloaded .saver file to install the screen saver.
  3. Open System Preferences > Desktop & Screen Saver > Screen Saver.
  4. Select "WebViewScreenSaver" from the list of screen savers.
  5. Click on "Screen Saver Options" to configure the URL or local HTML file to display.
  6. Optionally, set refresh interval and JavaScript execution preferences.

Note: For custom screen savers, create an HTML file with your desired content and point the screen saver to the local file path.

Competitor Comparisons

9,432

Open source Markdown editor for macOS.

Pros of macdown

  • Full-featured Markdown editor for macOS with live preview
  • Supports various Markdown flavors and extensions
  • Active development with regular updates and bug fixes

Cons of macdown

  • Limited to macOS platform
  • Larger codebase and more complex than a simple screensaver

Code comparison

macdown (Objective-C):

- (void)viewDidLoad {
    [super viewDidLoad];
    self.editorView.delegate = self;
    self.previewView.delegate = self;
    [self applyPreferences];
}

webviewscreensaver (Objective-C):

- (void)startAnimation {
    [super startAnimation];
    [self loadWebView];
    [NSTimer scheduledTimerWithTimeInterval:self.reloadInterval
                                     target:self
                                   selector:@selector(reload)
                                   userInfo:nil
                                    repeats:YES];
}

Summary

macdown is a comprehensive Markdown editor for macOS, offering a rich set of features and regular updates. It's more complex and platform-specific compared to webviewscreensaver, which is a simpler screensaver project. The code snippets show that macdown focuses on editor and preview functionality, while webviewscreensaver deals with loading and reloading web content for screensaver display.

Useful resources for creating apps with Electron

Pros of awesome-electron

  • Comprehensive resource list for Electron development
  • Regularly updated with new tools, libraries, and applications
  • Large community-driven project with many contributors

Cons of awesome-electron

  • Not an actual application or tool, just a curated list
  • Requires additional effort to implement any of the listed resources
  • May overwhelm beginners with the sheer amount of information

Code comparison

While a direct code comparison isn't relevant due to the nature of these projects, here's a brief example of how they differ:

awesome-electron:

## Apps

- [Atom](https://atom.io) - Text editor.
- [Visual Studio Code](https://code.visualstudio.com) - Cross-platform IDE.

webviewscreensaver:

- (void)startAnimation
{
    [super startAnimation];
    [self loadWebView];
}

Summary

awesome-electron is a comprehensive resource list for Electron development, offering a wide range of tools, libraries, and applications. It's regularly updated and community-driven, making it an excellent reference for developers. However, it's not an actual application and may be overwhelming for beginners.

webviewscreensaver, on the other hand, is a specific application that creates a screensaver using web content. It's more focused and practical for users looking to implement a web-based screensaver, but has a narrower scope compared to the broad resources offered by awesome-electron.

Clone to try a simple Electron app

Pros of electron-quick-start

  • Provides a comprehensive boilerplate for Electron applications
  • Includes a basic HTML/CSS/JS structure for quick prototyping
  • Offers cross-platform desktop application development capabilities

Cons of electron-quick-start

  • Larger file size and resource consumption due to Chromium engine
  • Requires more setup and configuration for specific use cases
  • Not specifically designed for screensaver functionality

Code Comparison

webviewscreensaver:

- (void)startAnimation
{
    [super startAnimation];
    [self loadURLString:[self.configuration objectForKey:@"url"]];
}

electron-quick-start:

const { app, BrowserWindow } = require('electron')

function createWindow () {
  const win = new BrowserWindow({ width: 800, height: 600 })
  win.loadFile('index.html')
}

Key Differences

  • webviewscreensaver is specifically designed for macOS screensavers using WebView
  • electron-quick-start is a general-purpose desktop application framework
  • webviewscreensaver uses Objective-C, while electron-quick-start uses JavaScript
  • electron-quick-start offers more flexibility for various application types
  • webviewscreensaver is more lightweight and focused on screensaver functionality

Make any web page a desktop application

Pros of Nativefier

  • Cross-platform support (macOS, Windows, Linux)
  • Converts any web app into a desktop application
  • Extensive customization options for the generated app

Cons of Nativefier

  • Larger file size due to bundling Electron
  • Requires Node.js and npm for installation and usage
  • May have performance overhead compared to native applications

Code Comparison

Webviewscreensaver (Objective-C):

- (void)animateOneFrame
{
    [super animateOneFrame];
    [self loadURLIfNeeded];
}

Nativefier (JavaScript):

app.on('ready', () => {
  createWindow();
  if (options.tray) {
    createTrayIcon();
  }
});

Key Differences

Webviewscreensaver is specifically designed for macOS screensavers, while Nativefier is a more versatile tool for creating desktop applications from web apps. Webviewscreensaver uses native macOS WebView, resulting in potentially better performance and smaller file size. Nativefier, on the other hand, offers cross-platform compatibility and more customization options but at the cost of larger file size and potential performance overhead.

Webviewscreensaver is written in Objective-C and integrates directly with macOS, while Nativefier uses JavaScript and Electron, making it more accessible to web developers but less optimized for specific platforms.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

WebViewScreenSaver

Build GitHub release

A macOS screen saver that displays a web page or a series of web pages.

Installation

brew install --cask webviewscreensaver --no-quarantine
  • Directly from the releases page. Unpack and double click to install.*

  • From source (requires Xcode):

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/liquidx/webviewscreensaver/master/install-from-source.sh)"

*Note: The package is adhoc signed (since v2.2.1, previously unsigned).

--no-quarantine disables macOS's Gatekeeper during installation.

Otherwise when opening it the first time you will get multiple security prompts about Apple not being able to verify the software.
Hit ok (cancel in older macOS) and go to Privacy & Security and scroll to bottom.
You'll find a section explaining that "WebViewScreenSaver.saver" was blocked click Open Anyway.
Upon returning to screensaver options you'll get a second prompt that can be confirmed by clicking Open.

Alternative if you installed it via direct download run the folllowing command to remove the file from quarantine:

xattr -d com.apple.quarantine WebViewScreenSaver.saver

Configuration

Open up System Preferences > Desktop and Screen Saver > Screen Saver and WebViewScreenSaver should be at the end of the list.

In the addresses section fill in as many websites as you want the screensaver to cycle through and the amount of time to pause on each.

Tip: To edit a selected row, click once or tap Enter or Tab.

Passing in a negative time value e.g. -1 will notify the screensaver to remain on that website indefinitely.

Need some website ideas? Check out suggestions in the examples. (feel free to suggest others)

The example file can also be used with the fetch URLs feature: https://raw.githubusercontent.com/liquidx/webviewscreensaver/master/examples.json

Local absolute paths can also be used as an address with or without the file:// schema.

E.g. file:///Users/myUser/mySreensaver/index.html

Note: If you are running Catalina or newer the provided path cannot reside in your personal folders which require extra permissions (this includes things like Downloads, Documents or Desktop) but can be anywhere else in your user's folder.

Configuration for IT

If you are interested in scripting configuration changes, WebViewScreenSaver, like most other screensavers, makes use of the macOS defaults system.

This can be queried and updated via:

/usr/libexec/PlistBuddy -c 'Print' ~/Library/Containers/com.apple.ScreenSaver.Engine.legacyScreenSaver/Data/Library/Preferences/ByHost/WebViewScreenSaver.*.plist

Depending on how it was installed, which macOS version and which architecture you are running you might find the plist under the following paths:

ls ~/Library/Containers/com.apple.ScreenSaver.Engine.legacyScreenSaver/Data/Library/Preferences/ByHost/WebViewScreenSaver.*
ls ~/Library/Containers/com.apple.ScreenSaver.Engine.legacyScreenSaver/Data/Library/Preferences/net.liquidx.WebViewScreenSaver
ls ~/Library/Containers/com.apple.ScreenSaver.Engine.legacyScreenSaver-x86_64/Data/Library/Preferences/net.liquidx.WebViewScreenSaver
ls ~/Library/Preferences/ByHost/WebViewScreenSaver.* # Pre macOS 10.15

Any .plist editor can be used including built-in PlistBuddy and plutil.

License

Code is licensed under the Apache License, Version 2.0 License.