mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-05-08 02:34:06 +02:00
Minor refactoring of ScriptLoader.ExecuteFile to generate identifier automatically
This commit is contained in:
parent
b531016c7b
commit
8e01d5ec84
@ -122,7 +122,7 @@ private void Browser_LoadingStateChanged(object sender, LoadingStateChangedEvent
|
||||
|
||||
private void Browser_FrameLoadEnd(object sender, FrameLoadEndEventArgs e){
|
||||
if (e.Frame.IsMain){
|
||||
ScriptLoader.ExecuteFile(browser,"code.js","root:code");
|
||||
ScriptLoader.ExecuteFile(browser,"code.js");
|
||||
plugins_Reloaded(plugins,new PluginLoadEventArgs(new string[0]));
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Linq;
|
||||
using CefSharp;
|
||||
using CefSharp.WinForms;
|
||||
|
||||
@ -20,12 +18,12 @@ public static string LoadResource(string name){
|
||||
}
|
||||
}
|
||||
|
||||
public static void ExecuteFile(ChromiumWebBrowser browser, string file, string identifier){
|
||||
ExecuteScript(browser,LoadResource(file),identifier);
|
||||
public static void ExecuteFile(ChromiumWebBrowser browser, string file){
|
||||
ExecuteScript(browser,LoadResource(file),"root:"+Path.GetFileNameWithoutExtension(file));
|
||||
}
|
||||
|
||||
public static void ExecuteFile(IFrame frame, string file, string identifier){
|
||||
ExecuteScript(frame,LoadResource(file),identifier);
|
||||
public static void ExecuteFile(IFrame frame, string file){
|
||||
ExecuteScript(frame,LoadResource(file),"root:"+Path.GetFileNameWithoutExtension(file));
|
||||
}
|
||||
|
||||
public static void ExecuteScript(ChromiumWebBrowser browser, string script, string identifier){
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using CefSharp;
|
||||
using CefSharp.WinForms;
|
||||
using TweetDck.Core;
|
||||
@ -25,7 +24,7 @@ public UpdateHandler(ChromiumWebBrowser browser, FormBrowser form){
|
||||
|
||||
private void browser_FrameLoadEnd(object sender, FrameLoadEndEventArgs e){
|
||||
if (e.Frame.IsMain){
|
||||
ScriptLoader.ExecuteFile(e.Frame,"update.js","root:update");
|
||||
ScriptLoader.ExecuteFile(e.Frame,"update.js");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user