Bug Fixes

Bug Fixes
master
Abdul Mannan 2022-02-15 01:41:59 +05:00
parent 18de5b8eb6
commit 483befe288
3 changed files with 17 additions and 13 deletions

View File

@ -218,11 +218,11 @@ public class geckoClients
private final WebExtension.PortDelegate mPortDelegate = new WebExtension.PortDelegate() {
@Override
public void onPortMessage(final @NonNull Object message,
final @NonNull WebExtension.Port port) {
if(message!=null && mSession.getProgress()==100){
public void onPortMessage(final @NonNull Object message,final @NonNull WebExtension.Port port) {
if(message!=null && mSession.getProgress()==100 && !mSession.mCloseRequested && mSession.isFirstPaintExecuted && !mSession.mOnBackPressed){
event.invokeObserver(Arrays.asList(message, mSession.getCurrentURL()), M_INDEX_WEBSITE);
}
mSession.mOnBackPressed = false;
}
@Override

View File

@ -115,10 +115,12 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes
private int m_current_url_id = -1;
private GeckoView mGeckoView;
private boolean mIsLoaded = false;
private boolean isFirstPaintExecuted = false;
public boolean isFirstPaintExecuted = false;
private boolean mIsProgressBarChanging = false;
private Handler mFindHandler;
private boolean mClosed = false;
public boolean mCloseRequested = false;
public boolean mOnBackPressed = false;
public SessionState mSessionState;
geckoSession(eventObserver.eventListener event,String mSessionID,AppCompatActivity mContext, GeckoView pGeckoView){
@ -314,6 +316,9 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes
@Override
public void onPageStart(@NonNull GeckoSession var1, @NonNull String var2) {
mCloseRequested = false;
isFirstPaintExecuted = false;
PrefsHelper.setPref(keys.PROXY_TYPE, 1);
PrefsHelper.setPref(keys.PROXY_SOCKS,"127.0.0.1");
PrefsHelper.setPref(keys.PROXY_SOCKS_PORT, orbotLocalConstants.mSOCKSPort);
@ -347,10 +352,9 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes
@UiThread
public void onPageStop(@NonNull GeckoSession var1, boolean var2) {
mCloseRequested = !var2;
if(var2){
if(mProgress>=100){
//event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.ON_UPDATE_THEME);
//event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme), enums.etype.on_update_favicon);
event.invokeObserver(Arrays.asList(null,mSessionID), enums.etype.on_page_loaded);
if(!mThemeChanged){
@ -760,6 +764,7 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes
@UiThread
public void onCloseRequest(@NonNull GeckoSession var1) {
if(!canGoBack() && !mClosed){
mCloseRequested = true;
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle), enums.etype.back_list_empty);
}
}
@ -767,6 +772,7 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes
int mCrashCount = 0;
@UiThread
public void onCrash(@NonNull GeckoSession session) {
mCloseRequested = true;
if(!mClosed && status.sSettingIsAppStarted){
if(event==null){
return;
@ -792,6 +798,7 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes
@UiThread
public void onKill(@NonNull GeckoSession session) {
mCloseRequested = true;
if(!mClosed && status.sSettingIsAppStarted){
if(event==null){
return;
@ -1159,6 +1166,7 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes
void goBackSession(){
wasBackPressed = true;
mOnBackPressed = true;
goBack();
try {

View File

@ -80,9 +80,6 @@ class crawlerDataModel
String mURL = strings.GENERIC_EMPTY_STR;
private void onSendRequest(){
if (mHTML.size()<100){
return;
}
RequestQueue mRequestQueue = Volley.newRequestQueue(mContext, new ProxiedHurlStack());
String url = "http://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/user_index/";
@ -116,10 +113,9 @@ class crawlerDataModel
crawlerRowModel mModel = mHTML.remove(0);
mHtml = mModel.getHTML();
mURL = mModel.getURL();
onParseHTML(mHtml, mURL);
onSendRequest();
if (mHTML.size()<100){
onSendRequest();
}
}
} catch (Exception ex) {
ex.printStackTrace();