D'oh, I just discoverd that the website I'd like to display has a
mobile version, which is already basic. I'll just display that instead
in my webView. This only needs some minor tweaks to remove one or two
divs, and saves me a lot of headaches.
- Koen.
On Sun, Aug 19, 2012 at 10:00 AM, Koen
On 18 Aug 2012, at 22:48, Koen van der Drift koenvanderdr...@gmail.com wrote:
Is there a similar way to inject an external javascript.js file into my
webView? I think I can use that to strip out the divs I don't want to show.
You could use the resource load delegate to substitute in a custom
So for future reference, I figured out how to add my local javascript.
This is what I do:
- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
{
if (frame == [sender mainFrame])
{
NSError *error = nil;
// get the DOMDocument
In my OS X app I show some webpages in a WebView, but I'd like to show them
stripped down, remove clutter, e.g. as is done in Evernote and other apps.
Any suggestions where to start? Maybe use a local css file?
- Koen.
___
Cocoa-dev mailing list
On Aug 18, 2012, at 7:24 AM, Koen van der Drift koenvanderdr...@gmail.com
wrote:
In my OS X app I show some webpages in a WebView, but I'd like to show them
stripped down, remove clutter, e.g. as is done in Evernote and other apps.
Any suggestions where to start? Maybe use a local css
How about asynchronously downloading the page HTML into a string, doing a text
replace of the name of the CSS file to your local one, then passing the
modified HTML to the web view?
Sent from my iPhone
On Aug 18, 2012, at 6:52 AM, Koen van der Drift koenvanderdr...@gmail.com
wrote:
On Aug
On Aug 18, 2012, at 8:26 AM, Steve Christensen puns...@mac.com wrote:
How about asynchronously downloading the page HTML into a string, doing a
text replace of the name of the CSS file to your local one, then passing the
modified HTML to the web view?
Doesn't work if there are style rules
On Aug 18, 2012, at 4:24 AM, Koen van der Drift koenvanderdr...@gmail.com
wrote:
In my OS X app I show some webpages in a WebView, but I'd like to show them
stripped down, remove clutter, e.g. as is done in Evernote and other apps.
Any suggestions where to start? Maybe use a local css
On Aug 18, 2012, at 1:40 PM, Kyle Sluder k...@ksluder.com wrote:
This is a good start. I believe user stylesheet is the term of art for a
local override stylesheet. From a quick Google, the relevant APIs are on the
WebPreferences class: -setUserStyleSheetEnabled: and
User stylesheets should work just fine, so you should try to figure out what's
going wrong with that. Perhaps don't use standardPreferences; use [self.webView
setPreferencesIdentifier:@mySpecialPreferences] to generate a new preferences
object for your WebView, then [self.webView preferences]
On Aug 18, 2012, at 2:46 PM, Matt Patenaude m...@mattpatenaude.com wrote:
User stylesheets should work just fine, so you should try to figure out
what's going wrong with that. Perhaps don't use standardPreferences; use
[self.webView setPreferencesIdentifier:@mySpecialPreferences] to
Ah! Your problem is URLWithString:. You want fileURLWithPath:. :)
-Matt
Sent from my iPhone
On Aug 18, 2012, at 12:12 PM, Koen van der Drift koenvanderdr...@gmail.com
wrote:
On Aug 18, 2012, at 2:46 PM, Matt Patenaude m...@mattpatenaude.com wrote:
User stylesheets should work just fine,
On Aug 18, 2012, at 3:26 PM, Matt Patenaude m...@mattpatenaude.com wrote:
Ah! Your problem is URLWithString:. You want fileURLWithPath:. :)
Well spotted, thanks!
- Koen.
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post
Is there a similar way to inject an external javascript.js file into my
webView? I think I can use that to strip out the divs I don't want to show.
On Aug 18, 2012, at 3:32 PM, Koen van der Drift koenvanderdr...@gmail.com
wrote:
On Aug 18, 2012, at 3:26 PM, Matt Patenaude
You can use the DOM: dynamically create a Script tag then allow it to
load more stuff by abusing -stringByEvaluatingJavaScriptFromString: .
On Aug 18, 2012, at 2:51 PM, Koen van der Drift
koenvanderdr...@gmail.com wrote:
Is there a similar way to inject an external javascript.js file into my
On Aug 18, 2012, at 11:29 AM, Koen van der Drift koenvanderdr...@gmail.com
wrote:
This is a good start. I believe user stylesheet is the term of art for a
local override stylesheet. From a quick Google, the relevant APIs are on the
WebPreferences class: -setUserStyleSheetEnabled: and
16 matches
Mail list logo