Rev 60 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 60 | Rev 61 | ||
---|---|---|---|
Line 126... | Line 126... | ||
126 | end; |
126 | end; |
127 | 127 | ||
128 | procedure TForm2.Timer1Timer(Sender: TObject); |
128 | procedure TForm2.Timer1Timer(Sender: TObject); |
129 | var |
129 | var |
130 | phpScript: string; |
130 | phpScript: string; |
- | 131 | sl: TStringList; |
|
131 | begin |
132 | begin |
132 | Timer1.Enabled := false; |
133 | Timer1.Enabled := false; |
133 | phpScript := ParamStr(1); |
134 | phpScript := ParamStr(1); |
134 | 135 | ||
135 | // Remove Security |
136 | // Remove Security |
Line 149... | Line 150... | ||
149 | WebBrowser1.LoadHTML(Format('<h1>FastPHP</h1>File %s does not exist.', [phpScript])); |
150 | WebBrowser1.LoadHTML(Format('<h1>FastPHP</h1>File %s does not exist.', [phpScript])); |
150 | Abort; |
151 | Abort; |
151 | end; |
152 | end; |
152 | 153 | ||
153 | WebBrowser1.LoadHTML(RunPHPScript(phpScript), phpScript); |
154 | WebBrowser1.LoadHTML(RunPHPScript(phpScript), phpScript); |
- | 155 | ||
- | 156 | Application.ProcessMessages; // This is important, otherwise the metatags can't be read... |
|
- | 157 | ||
- | 158 | sl := TStringList.Create; |
|
- | 159 | try |
|
- | 160 | WebBrowser1.ReadMetaTags(sl); |
|
- | 161 | // TODO: case insensitive |
|
- | 162 | if sl.Values['fastphp_title'] <> '' then Caption := sl.Values['fastphp_title']; |
|
- | 163 | if sl.Values['fastphp_width'] <> '' then ClientWidth := StrToInt(sl.Values['fastphp_width']); |
|
- | 164 | if sl.Values['fastphp_height'] <> '' then ClientHeight := StrToInt(sl.Values['fastphp_height']); |
|
- | 165 | // TODO: Add more attributes, like HTA applications had |
|
- | 166 | // TODO: Additionally implement "HTA:APPLICATION" element, see https://docs.microsoft.com/en-us/previous-versions//ms536495%28v%3dvs.85%29 |
|
- | 167 | finally |
|
- | 168 | FreeAndNil(sl); |
|
- | 169 | end; |
|
154 | end; |
170 | end; |
155 | 171 | ||
156 | procedure TForm2.WebBrowser1BeforeNavigate2(ASender: TObject; |
172 | procedure TForm2.WebBrowser1BeforeNavigate2(ASender: TObject; |
157 | const pDisp: IDispatch; const URL, Flags, TargetFrameName, PostData, |
173 | const pDisp: IDispatch; const URL, Flags, TargetFrameName, PostData, |
158 | Headers: OleVariant; var Cancel: WordBool); |
174 | Headers: OleVariant; var Cancel: WordBool); |