Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: AHGotoPage on 10.3.9
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AHGotoPage on 10.3.9



Hi Nick,

Thank you very much for the detailed information.
I understood.
I will try to change my code.

---
Keiichi Yamada
YUJIN Inc.

Nick Kocharhook wrote:

On May 9, 2005, at 1:39 AM, Keiichi Yamada wrote:

I wrote a PDE (Print Dialog Extension) for my printer driver.
Our own help file (HTML) is shown when the Help (?) button on Print
Dialog is clicked.
The 'help' event handler of my PDE calls AHGotoPage() like:

    status = AHGotoPage(NULL,

CFSTR("file:///Library/Printers/MyCompany/MyPrinter/MyPDE.plugin/ Contents/Resources/Help03/Japanese/pgs/print.htm"),
NULL);


We're no longer allowing this due to security concerns.

AHGotoPage() turns this request into a help:// URL, which is then passed to Help Viewer. But there's no way for Help Viewer to know if an arbitrary file passed to it via help:// is OK or if it's a page with malicious JS that has been downloaded without the user's knowledge.

Our solution to this problem was to only open pages from registered help books. A malicious web page can't call AHRegisterHelpBook(), so the user would actually have to download and run something to get a help book registered.

The side effect of this is that help:// URLs no longer work. The workaround is to use help:openbook URLs instead. One also uses AHGotoPage to create these, like so:

AHRegisterHelpBook(myAppBundle);
AHGotoPage(CFSTR("My App Help"), CFSTR("pgs/print.htm"), NULL);

But a blank page is shown on 10.3.9


This is known, but we weren't able to fix it for 10.3.9. Clearly, this isn't how Help Viewer should behave and we're going to try to address this for chablis.

I tried another test.
I added AHRegisterHelpBook() in Initialize() function like:

    CFURLRef bundleURL;
    FSRef    bundleFSRef;
    OSStatus status;

    bundleURL = CFBundleCopyBundleURL(mainBundle);
    CFURLGetFSRef(bundleURL, &bundleFSRef);
    status = AHRegisterHelpBook(&bundleFSRef);

The content of 'bundleFSRef' is
"/Library/Printers/MyCompany/MyPrinter/MyPDE.plugin".
This AHRegisterHelpBook() returns noErr.

But the AHGotoPage() does not work.
The same error message is shown on Console.


You're halfway there. We're going to post a Q&A about this problem soon.

-Nick



_______________________________________________ Do not post admin requests to the list. They will be ignored. Apple-help-authoring mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >AHGotoPage on 10.3.9 (From: Keiichi Yamada <email@hidden>)
 >Re: AHGotoPage on 10.3.9 (From: Nick Kocharhook <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.