Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap does not work with Awesomium #87

Open
sjoerd222888 opened this issue Jun 3, 2015 · 11 comments
Open

Bootstrap does not work with Awesomium #87

sjoerd222888 opened this issue Jun 3, 2015 · 11 comments
Assignees
Milestone

Comments

@sjoerd222888
Copy link

Tested with 1.7.5.1 (.Net)

To reproduce browse to http://getbootstrap.com/getting-started/ with an Awesomium Web view. You will notice that the menus are collapsed into the drop-down because somehow bootstrap fails to see the page size. The difference can be seen straight away when comparing with Chrome for example.

@sjoerd222888
Copy link
Author

Executing $(document).ready() in the dev console seems to make bootstrap work properly again. But this cannot be used as a workaround because calling that function from script has no effect, as far as I see it. See: http://stackoverflow.com/questions/30621677/events-similar-to-document-ready-to-be-used-as-workaround-for-issue-with-bootstr?noredirect=1#comment49310914_30621677

@atom0s
Copy link

atom0s commented Jun 8, 2015

I have this same problem with v1.7.5.1 C++. Bootstrap sites do not align properly by default. However if I open the remote debugger for the view, it magically fixes itself after the remote debugger finishes loading.

@atom0s
Copy link

atom0s commented Jun 8, 2015

I found a workaround for the time being. It is not the most elegant way to fix this but it does work.
You need to have a 'load' listener set for your web view. You can do that like this:

    this->m_WebView->set_load_listener(this);

Inside of the event 'OnDocumentReady' you can do the following to force the page to update and realign properly:

void YourClassObjectNameHere::OnDocumentReady(Awesomium::WebView* caller, const Awesomium::WebURL& url)
{
    caller->ExecuteJavascript(Awesomium::WSLit("window.scrollTo(0,-1);"), Awesomium::WSLit(""));
}

When the page loads it should fix itself. This works for me with the latest C++ build of Awesomium.

@sjoerd222888
Copy link
Author

I have tried to implement this workaround for .Net with no success. I don't know what would correspond to set_load_listener but executing window.scrollTo(0,-1); in the DocumentReady event handler has no effect for me.

@atom0s
Copy link

atom0s commented Jun 9, 2015

Try using the 'OnFinishLoadingFrame'. Check if the current frame the call is for is the main frame, if so then execute the JS.

@sjoerd222888
Copy link
Author

This event does not exist in .Net. There exists LoadingFrameComplete and I tried execute the JS there with no effect.

@sjoerd222888
Copy link
Author

Btw. it does also not work on OS X using OSMWebView.

@Perikles
Copy link

There can be no native solution to this until v2.0 that will upgrade the version of Chromium Awesomium is based on, but we will investigate how the suggested workarounds can be applied on Awesomium.NET.

@Perikles Perikles added this to the 1.7.6 milestone Aug 10, 2015
@Perikles Perikles self-assigned this Aug 10, 2015
@sjoerd222888
Copy link
Author

Btw. This might also be the reason for this issue:
http://answers.awesomium.com/questions/5958/inspector-size-ssue.html

@sjoerd222888
Copy link
Author

Are there any updates regarding a workaround?

@atom0s
Copy link

atom0s commented Sep 22, 2015

I ditched Awesomium and moved to CEF since Awesomium is obviously abandon-ware at this rate.

@Perikles Perikles modified the milestones: 1.7.6, 1.7.7 Nov 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants