Subversion Repositories Kolibri OS

Rev

Rev 5779 | Rev 5782 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. //HTML Viewer in C--
  2. //Copyright 2007-2013 by Veliant & Leency
  3. //Asper, lev, Lrz, Barsuk, Nable...
  4. //home icon - rachel fu, GPL licence
  5.  
  6. #ifndef AUTOBUILD
  7.         #include "lang.h--"
  8. #endif
  9.  
  10. //libraries
  11. #define MEMSIZE 0x100000
  12. #include "..\lib\gui.h"
  13. #include "..\lib\draw_buf.h"
  14. #include "..\lib\list_box.h"
  15. #include "..\lib\cursor.h"
  16. //*.obj libraries
  17. #include "..\lib\obj\box_lib.h"
  18. #include "..\lib\obj\libio_lib.h"
  19. #include "..\lib\obj\libimg_lib.h"
  20. #include "..\lib\obj\http.h"
  21. #include "..\lib\obj\iconv.h"
  22. //useful patterns
  23. #include "..\lib\patterns\libimg_load_skin.h"
  24.  
  25. char homepage[] = FROM "html\\homepage.htm";
  26.  
  27. #ifdef LANG_RUS
  28.         char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 1.39";
  29.         ?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
  30.         ?define T_LAST_SLIDE "â® ¯®á«¥¤­¨© á« ©¤"
  31.         char loading[] = "‡ £à㧪  áâà ­¨æë...<br>";
  32.         char page_not_found[] = FROM "html\page_not_found_ru.htm";
  33.         char accept_language[]= "Accept-Language: ru\n";
  34. #else
  35.         char version[]=" Text-based Browser 1.39";
  36.         ?define IMAGES_CACHE_CLEARED "Images cache cleared"
  37.         ?define T_LAST_SLIDE "This slide is the last"
  38.         char loading[] = "Loading...<br>";
  39.         char page_not_found[] = FROM "html\page_not_found_en.htm";
  40.         char accept_language[]= "Accept-Language: en\n";       
  41. #endif
  42.  
  43. #define URL_SERVICE_HISTORY "WebView://history"
  44. #define URL_SERVICE_HOME "WebView://home"
  45. #define URL_SERVICE_SOURCE "WebView://source:"
  46.  
  47.  
  48. proc_info Form;
  49.  
  50. //char search_path[]="http://nigma.ru/index.php?s=";
  51. int redirected = 0;
  52.  
  53. char stak[4096];
  54.  
  55. int action_buf;
  56.  
  57. dword http_transfer = 0;
  58. dword http_buffer;
  59.  
  60. dword TOOLBAR_H = 33;
  61. dword STATUSBAR_H = 15;
  62. dword col_bg;
  63. dword panel_color;
  64. dword border_color;
  65.  
  66. progress_bar wv_progress_bar;
  67. byte souce_mode = false;
  68.  
  69. enum {
  70.         BACK_BUTTON=1000,
  71.         FORWARD_BUTTON,
  72.         REFRESH_BUTTON,
  73.         GOTOURL_BUTTON,
  74.         SANDWICH_BUTTON
  75. };
  76.  
  77. enum {
  78.         VIEW_SOURCE=1100,
  79.         EDIT_SOURCE,
  80.         VIEW_HISTORY,
  81.         FREE_IMG_CACHE,
  82.         DOWNLOAD_MANAGER
  83. };
  84.  
  85. #include "..\TWB\TWB.c"
  86. #include "menu.h"
  87. #include "history.h"
  88. #include "show_src.h"
  89. #include "network_get.h"
  90. #include "downloader.h"
  91.  
  92. char editURL[sizeof(URL)];
  93. int     mouse_twb;
  94. edit_box address_box = {250,56,34,0xffffff,0x94AECE,0xffffff,0xffffff,0,sizeof(URL),#editURL,#mouse_twb,2,19,19};
  95.  
  96.  
  97. void main()
  98. {
  99.         dword btn;
  100.         int half_scroll_size;
  101.         int scroll_used=0, show_menu;
  102.         CursorPointer.Load(#CursorFile);
  103.         load_dll(boxlib, #box_lib_init,0);
  104.         load_dll(libio, #libio_init,1);
  105.         load_dll(libimg, #libimg_init,1);
  106.         load_dll(libHTTP, #http_lib_init,1);
  107.         load_dll(iconv_lib, #iconv_open,0);
  108.         //load_dll(kmenu, #akmenu_init,0);
  109.         Libimg_LoadImage(#skin, abspath("wv_skin.png"));
  110.         SetSkinColors();
  111.         CreateDir("/tmp0/1/downloads");
  112.         if (param) strcpy(#URL, #param); else strcpy(#URL, URL_SERVICE_HOME);
  113.         WB1.DrawBuf.zoom = 1;
  114.         WB1.list.SetFont(8, 14, 10111000b);
  115.         WB1.list.no_selection = true;
  116.         SetEventMask(0xa7);
  117.         BEGIN_LOOP_APPLICATION:
  118.                 WaitEventTimeout(2);
  119.                 switch(EAX & 0xFF)
  120.                 {
  121.                         CASE evMouse:
  122.                                 if (!CheckActiveProcess(Form.ID)) break;
  123.                                 edit_box_mouse stdcall (#address_box);
  124.                                 mouse.get();
  125.                                 if (WB1.list.MouseOver(mouse.x, mouse.y))
  126.                                 {
  127.                                         PageLinks.Hover(mouse.x, WB1.list.first*WB1.list.line_h + mouse.y, link_color_inactive, link_color_active, bg_color);
  128.                                         if (bufsize) && (mouse.pkm) && (mouse.up) { CreateThread(#menu_rmb,#stak+4092); break; }
  129.                                         if (WB1.list.MouseScroll(mouse.vert)) WB1.DrawPage();
  130.                                 }
  131.                                 //Drag scroller
  132.                                 scroll_wv.all_redraw = 0;
  133.                                 if (!mouse.lkm) scroll_used=0;
  134.                                 if (mouse.x>=scroll_wv.start_x) && (mouse.x<=scroll_wv.start_x+scroll_wv.size_x)
  135.                                 && (mouse.y>=scroll_wv.start_y+scroll_wv.btn_height) && (-scroll_wv.btn_height+scroll_wv.start_y+scroll_wv.size_y>mouse.y)
  136.                                 && (WB1.list.count>WB1.list.visible) && (mouse.lkm) scroll_used=1;
  137.                                 if (scroll_used)
  138.                                 {
  139.                                         mouse.y = mouse.y + 5;
  140.                                         half_scroll_size = WB1.list.h - 16 * WB1.list.visible / WB1.list.count - 3 /2;
  141.                                         if (half_scroll_size+WB1.list.y>mouse.y) || (mouse.y<0) || (mouse.y>4000) mouse.y=half_scroll_size+WB1.list.y;
  142.                                         btn=WB1.list.first;
  143.                                         WB1.list.first = mouse.y -half_scroll_size -WB1.list.y * WB1.list.count / WB1.list.h;
  144.                                         if (WB1.list.visible+WB1.list.first>WB1.list.count) WB1.list.first=WB1.list.count-WB1.list.visible;
  145.                                         if (btn!=WB1.list.first) WB1.DrawPage();
  146.                                 }
  147.                                 break;
  148.  
  149.                         case evButton:
  150.                                 btn=GetButtonID();
  151.                                 if (btn==1)     ExitProcess();
  152.                                 Scan(btn);
  153.                                 break;
  154.  
  155.                         case evKey:
  156.                                 GetKeys();
  157.                                 if (address_box.flags & 0b10)  
  158.                                 {
  159.                                         if (key_ascii == ASCII_KEY_ENTER) Scan(key_scancode); else
  160.                                         if (key_ascii != 0x0d) && (key_ascii != 183) && (key_ascii != 184) {EAX = key_ascii << 8; edit_box_key stdcall(#address_box);}
  161.                                 }
  162.                                 else
  163.                                 {
  164.                                         Scan(key_scancode);
  165.                                 }
  166.                                 break;
  167.  
  168.                         case evReDraw:
  169.                                 if (action_buf) Scan(action_buf);
  170.                                 DefineAndDrawWindow(GetScreenWidth()-800/2,GetScreenHeight()-600/2,800,600,0x73,col_bg,0,0);
  171.                                 GetProcessInfo(#Form, SelfInfo);
  172.                                 if (Form.status_window>2) { DrawTitle(#header); break; }
  173.                                 if (Form.height<120) MoveSize(OLD,OLD,OLD,120);
  174.                                 if (Form.width<280) MoveSize(OLD,OLD,280,OLD);
  175.                                 Draw_Window();
  176.                                 break;
  177.                                
  178.                         case evNetwork:
  179.                                 if (http_transfer > 0) {
  180.                                         http_receive stdcall (http_transfer);
  181.                                         $push EAX
  182.                                         ESI = http_transfer;
  183.                                         wv_progress_bar.max = ESI.http_msg.content_length;
  184.                                         if (wv_progress_bar.value != ESI.http_msg.content_received)
  185.                                         {
  186.                                                 wv_progress_bar.value = ESI.http_msg.content_received; 
  187.                                                 DrawProgress();
  188.                                         }
  189.                                         $pop EAX
  190.                                         if (EAX == 0) {
  191.                                                 ESI = http_transfer;
  192.                                                 // Handle redirects
  193.                                                 if (ESI.http_msg.status >= 300) && (ESI.http_msg.status < 400)
  194.                                                 {
  195.                                                         redirected++;
  196.                                                         if (redirected<=5)
  197.                                                         {
  198.                                                                 http_find_header_field stdcall (http_transfer, "location\0");
  199.                                                                 if (EAX!=0) {
  200.                                                                         ESI = EAX;
  201.                                                                         EDI = #URL;
  202.                                                                         do {
  203.                                                                                 $lodsb;
  204.                                                                                 $stosb;
  205.                                                                         } while (AL != 0) && (AL != 13) && (AL != 10));
  206.                                                                         DSBYTE[EDI-1]='\0';
  207.                                                                 }
  208.                                                         }
  209.                                                         else
  210.                                                         {
  211.                                                                 notify("Too many redirects");
  212.                                                                 StopLoading();
  213.                                                                 break;
  214.                                                         }
  215.                                                 }
  216.                                                 else
  217.                                                 {
  218.                                                         redirected = 0;
  219.                                                 }
  220.                                                 // Loading the page is complete, free resources
  221.                                                 if (redirected>0)
  222.                                                 {
  223.                                                         http_free stdcall (http_transfer);
  224.                                                         http_transfer=0;
  225.                                                         PageLinks.GetAbsoluteURL(#URL);
  226.                                                         BrowserHistory.current--;
  227.                                                         strcpy(#editURL, #URL);
  228.                                                         DrawEditBox();
  229.                                                         OpenPage();
  230.                                                 }
  231.                                                 else
  232.                                                 {
  233.                                                         BrowserHistory.AddUrl();
  234.                                                         ESI = http_transfer;
  235.                                                         bufpointer = ESI.http_msg.content_ptr;
  236.                                                         bufsize = ESI.http_msg.content_received;
  237.                                                         http_free stdcall (http_transfer);
  238.                                                         http_transfer=0;
  239.                                                         SetPageDefaults();
  240.                                                         ShowPage();
  241.                                                 }
  242.                                         }
  243.                                 }
  244.                 }
  245.         goto BEGIN_LOOP_APPLICATION;
  246. }
  247.  
  248. void SetElementSizes()
  249. {
  250.         address_box.top = TOOLBAR_H/2-7;
  251.         address_box.width = Form.cwidth - address_box.left - 25 - 22;
  252.         WB1.list.SetSizes(0, TOOLBAR_H, Form.width - 10 - scroll_wv.size_x / WB1.DrawBuf.zoom,
  253.                 Form.cheight - TOOLBAR_H - STATUSBAR_H, WB1.list.font_h + WB1.DrawBuf.zoom + WB1.DrawBuf.zoom * WB1.DrawBuf.zoom);
  254.         WB1.list.wheel_size = 7;
  255.         WB1.list.column_max = WB1.list.w - scroll_wv.size_x / WB1.list.font_w;
  256.         WB1.list.visible = WB1.list.h - 5 / WB1.list.line_h;
  257.         if (WB1.list.w!=WB1.DrawBuf.bufw) WB1.DrawBuf.Init(WB1.list.x, WB1.list.y, WB1.list.w, WB1.list.h * 30);
  258. }
  259.  
  260. void Draw_Window()
  261. {
  262.         DrawBar(0,0, Form.cwidth,TOOLBAR_H-2, panel_color);
  263.         DrawBar(0,TOOLBAR_H-2, Form.cwidth,1, 0xD7D0D3);
  264.         DrawBar(0,TOOLBAR_H-1, Form.cwidth,1, border_color);
  265.         SetElementSizes();
  266.         DrawRectangle(address_box.left-3, address_box.top-3, address_box.width+5, 20,border_color);
  267.         DefineButton(address_box.left-50, address_box.top-2, 23, skin.h-2, BACK_BUTTON+BT_HIDE, 0);
  268.         DefineButton(address_box.left-26, address_box.top-2, 23, skin.h-2, FORWARD_BUTTON+BT_HIDE, 0);
  269.         img_draw stdcall(skin.image, address_box.left-51, address_box.top-3, 48, skin.h, 3, 0);
  270.         DefineButton(address_box.left+address_box.width+1, address_box.top-3, 16, skin.h-1, REFRESH_BUTTON+BT_HIDE+BT_NOFRAME, 0);
  271.         DefineButton(Form.cwidth-24, address_box.top-3, 19, skin.h-1, SANDWICH_BUTTON+BT_HIDE, 0);
  272.         img_draw stdcall(skin.image, Form.cwidth-22, address_box.top-3, 16, skin.h, 85, 0);
  273.         DrawBar(0,Form.cheight - STATUSBAR_H, Form.cwidth,STATUSBAR_H, col_bg);
  274.         DrawBar(0,Form.cheight - STATUSBAR_H, Form.cwidth,1, border_color);
  275.         if (!header) OpenPage(); else { WB1.DrawPage(); DrawEditBox(); }
  276.         DrawRectangle(scroll_wv.start_x, scroll_wv.start_y, scroll_wv.size_x, scroll_wv.size_y-1, scroll_wv.bckg_col);
  277.         DrawProgress();
  278. }
  279.  
  280.  
  281. void Scan(dword id__)
  282. {
  283.         action_buf=0;
  284.         if (WB1.list.ProcessKey(id__)) WB1.DrawPage();
  285.         else switch (id__)
  286.         {
  287.                 case SCAN_CODE_BS:
  288.                 case BACK_BUTTON:
  289.                         if (!BrowserHistory.GoBack()) return;
  290.                         OpenPage();
  291.                         return;
  292.                 case FORWARD_BUTTON:
  293.                         if (!BrowserHistory.GoForward()) return;
  294.                         OpenPage();
  295.                         return;
  296.                 case GOTOURL_BUTTON:
  297.                 case SCAN_CODE_ENTER:
  298.                         if (!strncmp(#editURL,"http:",5)) || (editURL[0]=='/') || (!strncmp(#editURL,"WebView:",9))
  299.                         {
  300.                                 strcpy(#URL, #editURL);
  301.                         }
  302.                         else
  303.                         {
  304.                                 strncpy(#URL,"http://",7);
  305.                                 strcat(#URL, #editURL);
  306.                         }
  307.                         OpenPage();
  308.                         return;
  309.                 case 063: //F5
  310.                         IF(address_box.flags & 0b10) return;
  311.                 case REFRESH_BUTTON:
  312.                         if (http_transfer > 0)
  313.                         {
  314.                                 StopLoading();
  315.                                 Draw_Window();
  316.                         }
  317.                         else OpenPage();
  318.                         return;
  319.                 case SANDWICH_BUTTON:
  320.                         mouse.y = TOOLBAR_H-6;
  321.                         mouse.x = Form.cwidth - 167;
  322.                         CreateThread(#menu_rmb,#stak+4092);
  323.                         return;
  324.                 case VIEW_SOURCE:
  325.                         WB1.list.first = 0;
  326.                         ShowSource();
  327.                         WB1.LoadInternalPage(bufpointer, bufsize);
  328.                         break;
  329.                 case EDIT_SOURCE:
  330.                         if (!strncmp(#URL,"http:",5))
  331.                         {
  332.                                 WriteFile(bufsize, bufpointer, "/tmp0/1/WebView_tmp.htm");
  333.                                 if (!EAX) RunProgram("/rd/1/tinypad", "/tmp0/1/WebView_tmp.htm");
  334.                         }
  335.                         else RunProgram("/rd/1/tinypad", #URL);
  336.                         return;
  337.                 case FREE_IMG_CACHE:
  338.                         ImgCache.Free();
  339.                         notify(IMAGES_CACHE_CLEARED);
  340.                         WB1.DrawPage();
  341.                         return;
  342.                 case VIEW_HISTORY:
  343.                         strcpy(#URL, URL_SERVICE_HISTORY);
  344.                         OpenPage();
  345.                         return;
  346.                 case DOWNLOAD_MANAGER:
  347.                         if (!downloader_opened) {
  348.                                 strncpy(#DL_URL, "http://",7);
  349.                                 CreateThread(#Downloader,#downloader_stak+4092);
  350.                         }
  351.                         return; /*
  352.                 case 020:
  353.                 case NEWTAB:
  354.                         MoveSize(190,80,OLD,OLD);
  355.                         RunProgram(#program_path, #URL);
  356.                         return;
  357.                 case SEARCHWEB_BUTTON:
  358.                         sprintf(#URL,"%s%s",#search_path,#editURL);
  359.                         OpenPage();
  360.                         return; */
  361.         }
  362. }
  363.  
  364.  
  365. void StopLoading()
  366. {
  367.         if (http_transfer)
  368.         {
  369.                 EAX = http_transfer;
  370.                 EAX = EAX.http_msg.content_ptr;         // get pointer to data
  371.                 $push   EAX                                                     // save it on the stack
  372.                 http_free stdcall (http_transfer);      // abort connection
  373.                 $pop    EAX                                                    
  374.                 free(EAX);                                              // free data
  375.                 http_transfer=0;
  376.                 bufsize = 0;
  377.                 bufpointer = free(bufpointer);
  378.         }
  379.         wv_progress_bar.value = 0;
  380.         img_draw stdcall(skin.image, address_box.left+address_box.width+1, address_box.top-3, 17, skin.h, 52, 0);
  381. }
  382.  
  383. void SetPageDefaults()
  384. {
  385.         strcpy(#header, #version);
  386.         WB1.list.count = WB1.list.first = 0;
  387.         stroka = 0;
  388.         cur_encoding = CH_NULL;
  389.         if (o_bufpointer) o_bufpointer = free(o_bufpointer);
  390.         anchor_line_num=WB1.list.first;
  391.         anchor[0]='|';
  392. }
  393.  
  394. void OpenPage()
  395. {
  396.         StopLoading();
  397.         souce_mode = false;
  398.         strcpy(#editURL, #URL);
  399.         BrowserHistory.AddUrl();
  400.         if (!strncmp(#URL,"WebView:",8))
  401.         {
  402.                 SetPageDefaults();
  403.                 if (!strcmp(#URL, URL_SERVICE_HOME)) WB1.LoadInternalPage(#homepage, sizeof(homepage));
  404.                 else if (!strcmp(#URL, URL_SERVICE_HISTORY)) ShowHistory();
  405.                 DrawEditBox();
  406.                 return;
  407.         }
  408.         if (!strncmp(#URL,"http:",5))
  409.         {
  410.                 img_draw stdcall(skin.image, address_box.left+address_box.width+1, address_box.top-3, 17, skin.h, 131, 0);
  411.                 http_get stdcall (#URL, 0, 0, #accept_language);
  412.                 http_transfer = EAX;
  413.                 if (!http_transfer)
  414.                 {
  415.                         StopLoading();
  416.                         bufsize = 0;
  417.                         bufpointer = free(bufpointer);
  418.                         ShowPage();
  419.                         return;
  420.                 }
  421.         }
  422.         else
  423.         {
  424.                 file_size stdcall (#URL);
  425.                 bufsize = EBX;
  426.                 if (bufsize)
  427.                 {
  428.                         free(bufpointer);
  429.                         bufpointer = malloc(bufsize);
  430.                         SetPageDefaults();
  431.                         ReadFile(0, bufsize, bufpointer, #URL);
  432.                 }
  433.                 ShowPage();
  434.         }
  435. }
  436.  
  437. DrawEditBox()
  438. {
  439.         DrawWideRectangle(address_box.left-2, address_box.top-2, address_box.width+3, 19, 2, address_box.color);
  440.         address_box.size = address_box.pos = address_box.shift = address_box.shift_old = strlen(#editURL);
  441.         address_box.offset = 0;
  442.         edit_box_draw stdcall(#address_box);
  443.         if (http_transfer > 0) EAX = 131; else EAX = 52;
  444.         img_draw stdcall(skin.image, address_box.left+address_box.width+1, address_box.top-3, 17, skin.h, EAX, 0);
  445. }
  446.  
  447.  
  448. void ShowPage()
  449. {
  450.         DrawEditBox();
  451.         if (!bufsize)
  452.         {
  453.                 if (http_transfer) WB1.LoadInternalPage(#loading, sizeof(loading));
  454.                 else WB1.LoadInternalPage(#page_not_found, sizeof(page_not_found));
  455.         }
  456.         else
  457.         {
  458.                 WB1.Prepare();
  459.         }
  460.  
  461.         //if (!header) strcpy(#header, #version);
  462.         if (!strcmp(#version, #header)) DrawTitle(#header);
  463. }
  464.  
  465. byte UrlExtIs(dword ext)
  466. {
  467.         if (!strcmpi(#URL + strlen(#URL) - strlen(ext), ext)) return true;
  468.         return false;
  469. }
  470.  
  471. int SetSkinColors()
  472. {
  473.         dword image_data;
  474.         image_data = DSDWORD[skin.image+24];
  475.         col_bg = DSDWORD[image_data];
  476.         panel_color  = DSDWORD[skin.w*4*4 + image_data];
  477.         border_color = DSDWORD[skin.w*4*7 + image_data];
  478.         wv_progress_bar.progress_color = DSDWORD[skin.w*4*10 + image_data];
  479.         $and col_bg, 0x00ffffff
  480.         $and panel_color, 0x00ffffff
  481.         $and border_color, 0x00ffffff
  482.         $and wv_progress_bar.progress_color, 0x00ffffff
  483. }
  484.  
  485. void DrawProgress()
  486. {
  487.         unsigned long btn;
  488.         if (http_transfer == 0) return;
  489.         if (wv_progress_bar.max) btn = address_box.width*wv_progress_bar.value/wv_progress_bar.max; else btn = 30;
  490.         DrawBar(address_box.left-2, address_box.top+15, btn, 2, wv_progress_bar.progress_color);
  491. }
  492.  
  493. void ClickLink()
  494. {
  495.         if (http_transfer > 0)
  496.         {
  497.                 StopLoading();
  498.                 BrowserHistory.current--;
  499.         }
  500.  
  501.         strcpy(#URL, PageLinks.GetURL(PageLinks.active));      
  502.         //#1
  503.         if (URL[0] == '#')
  504.         {
  505.                 strcpy(#anchor, #URL+strrchr(#URL, '#'));              
  506.                 strcpy(#URL, BrowserHistory.CurrentUrl());
  507.                 WB1.list.first=WB1.list.count-WB1.list.visible;
  508.                 ShowPage();
  509.                 return;
  510.         }
  511.         //liner.ru#1
  512.         if (strrchr(#URL, '#')!=-1)
  513.         {
  514.                 strcpy(#anchor, #URL+strrchr(#URL, '#'));
  515.                 URL[strrchr(#URL, '#')-1] = 0x00;
  516.         }
  517.        
  518.         PageLinks.GetAbsoluteURL(#URL);
  519.        
  520.         if (UrlExtIs(".png")==1) || (UrlExtIs(".gif")==1) || (UrlExtIs(".jpg")==1) || (UrlExtIs(".zip")==1) || (UrlExtIs(".kex")==1)
  521.         || (UrlExtIs(".7z")==1) || (UrlExtIs("netcfg")==1)
  522.         {
  523.                 //notify(#URL);
  524.                 if (!strncmp(#URL,"http://", 7))
  525.                 {
  526.                         strcpy(#DL_URL, #URL);
  527.                         CreateThread(#Downloader,#downloader_stak+4092);
  528.                 }
  529.                 else RunProgram("@open", #URL);
  530.                 strcpy(#editURL, BrowserHistory.CurrentUrl());
  531.                 strcpy(#URL, BrowserHistory.CurrentUrl());
  532.                 return;
  533.         }
  534.         if (!strncmp(#URL,"mailto:", 7))
  535.         {
  536.                 notify(#URL);
  537.                 strcpy(#editURL, BrowserHistory.CurrentUrl());
  538.                 strcpy(#URL, BrowserHistory.CurrentUrl());
  539.                 return;
  540.         }
  541.         OpenPage();
  542.         return;
  543. }
  544.  
  545.  
  546. char downloader_stak[4096];
  547. stop: