mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-19 20:08:54 +00:00
mshtml: Use zone mapping instead of hardcoded protocols in use_gecko_script.
This commit is contained in:
parent
739ff1208e
commit
3e422b9ed8
|
@ -48,15 +48,22 @@ typedef struct {
|
|||
LPOLESTR url;
|
||||
} download_proc_task_t;
|
||||
|
||||
static BOOL use_gecko_script(LPCWSTR url)
|
||||
static BOOL use_gecko_script(HTMLWindow *window)
|
||||
{
|
||||
static const WCHAR fileW[] = {'f','i','l','e',':'};
|
||||
static const WCHAR aboutW[] = {'a','b','o','u','t',':'};
|
||||
static const WCHAR resW[] = {'r','e','s',':'};
|
||||
DWORD zone;
|
||||
HRESULT hres;
|
||||
|
||||
return strncmpiW(fileW, url, sizeof(fileW)/sizeof(WCHAR))
|
||||
&& strncmpiW(aboutW, url, sizeof(aboutW)/sizeof(WCHAR))
|
||||
&& strncmpiW(resW, url, sizeof(resW)/sizeof(WCHAR));
|
||||
static const WCHAR aboutW[] = {'a','b','o','u','t',':'};
|
||||
|
||||
hres = IInternetSecurityManager_MapUrlToZone(window->secmgr, window->url, &zone, 0);
|
||||
if(FAILED(hres)) {
|
||||
WARN("Could not map %s to zone: %08x\n", debugstr_w(window->url), hres);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
TRACE("zone %d\n", zone);
|
||||
return zone != URLZONE_LOCAL_MACHINE && zone != URLZONE_TRUSTED
|
||||
&& strncmpiW(aboutW, window->url, sizeof(aboutW)/sizeof(WCHAR));
|
||||
}
|
||||
|
||||
void set_current_mon(HTMLWindow *This, IMoniker *mon)
|
||||
|
@ -83,7 +90,7 @@ void set_current_mon(HTMLWindow *This, IMoniker *mon)
|
|||
if(FAILED(hres))
|
||||
WARN("GetDisplayName failed: %08x\n", hres);
|
||||
|
||||
set_script_mode(This, use_gecko_script(This->url) ? SCRIPTMODE_GECKO : SCRIPTMODE_ACTIVESCRIPT);
|
||||
set_script_mode(This, use_gecko_script(This) ? SCRIPTMODE_GECKO : SCRIPTMODE_ACTIVESCRIPT);
|
||||
}
|
||||
|
||||
static void set_progress_proc(task_t *_task)
|
||||
|
|
Loading…
Reference in a new issue