Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't find index.html #6

Open
theirf opened this issue May 23, 2013 · 8 comments
Open

Can't find index.html #6

theirf opened this issue May 23, 2013 · 8 comments

Comments

@theirf
Copy link

theirf commented May 23, 2013

I'm trying to edit the URL to a page I want as my screensaver, but I can not find ' Web.saver/Contents/Resources/index.html ' in any of the files.

When I explored Web.saver's package contents I couldn't find a Resources dir / folder.

.

@konsumer
Copy link

konsumer commented Aug 7, 2013

Just make a folder Web.saver/Contents/Resources/ and create a HTML file called index.html. Worked for me.

@konsumer
Copy link

konsumer commented Aug 8, 2013

that said, when I build it myself in Xcode, it always loads the github page.

@kinopyo
Copy link

kinopyo commented Aug 24, 2013

I think the readme is quite outdated, here is how to let it work as it's "advertised":

Steps

(I'm a total newbie for Xcode and iOS/Mac development, so I described every detail and my have some mistakes.)

  1. Forget about the build/Release/Web.saver, it doesn't work, you have to edit and build from Xcode.
  2. Open the WebSaver.xcodeproj file in Xcode, then find WebSaverView.m, comment out L53 (https://github.com/tlrobinson/WebSaver/blob/master/WebSaverView.m#L53) and modify it like this:
webView = [[WebView alloc] initWithFrame:[self bounds] frameName:nil groupName:nil];

[webView setFrameLoadDelegate:self];
[webView setMainFrameURL:[NSString stringWithFormat:@"file://%@/index.html", [[NSBundle bundleForClass:[self class]] resourcePath]]];
[self addSubview:webView];

// [self loadWebView];
  1. Press cmd + B to build it, you should find the built file in ~/Library/Developer/Xcode/WebSaver-randome-string/Build/Products/Debug/WebSaver.saver
  2. Right click WebSaver.saver then choose Show Package Contents, jump to Contents/Resources then create the index.html file, put some contents there.
  3. Go back to directory of ~/Library/Developer/Xcode/WebSaver-randome-string/Build/Products/Debug/WebSaver.saver and double click it to install.
  4. Now you should be able to show the screensaver with the contents of your index.html file.

Some explanation

What I did in Xcode is to let it actually read file from index.html.

[webView setMainFrameURL:[NSString stringWithFormat:@"file://%@/index.html", [[NSBundle bundleForClass:[self class]] resourcePath]]];

This is the code the author committed at first: 7369c4a

But this logic was removed at commit of 1d62ad2#L6L20, don't know why...

@konsumer
Copy link

I think it was removed so the preferences dialog lets you choose a URL.

A simpler solution is to edit "loadWebView" method.

change

[webView setMainFrameURL:[defaults valueForKey:URL_KEY]];

to

[webView setMainFrameURL:[NSString stringWithFormat:@"file://%@/index.html", [[NSBundle bundleForClass:[self class]] resourcePath]]];

I think a better-still solution would be a radio button for selecting local file or remote URL in preferences dialog.

@sapegin
Copy link

sapegin commented Nov 13, 2014

Just make a folder Web.saver/Contents/Resources/ and create a HTML file called index.html.

Works fine for me too.

@rifler
Copy link

rifler commented Nov 13, 2014

Make where? In home directory?

@sapegin
Copy link

sapegin commented Nov 13, 2014

@rifler In Web.saver/Contents/Resources/.

@konsumer
Copy link

(right-click, "Show Package Contents" for Web.saver)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants