Skip to content
This repository

Fix remote inspector when building statically. #291

Merged
merged 1 commit into from almost 2 years ago

2 participants

Jon Leighton Ariya Hidayat
Jon Leighton

For some reason, it seems that checking CONFIG(static) inside
src/phantomjs.pro is not reliable. That caused the STATIC_BUILD define
not to be set, and hence Q_INIT_RESOURCE would never get called in
main.cpp.

Instead of using Q_INIT_RESOURCE, let's just compile the resources
directly into the phantomjs binary. This means we don't need to detect
whether Qt is linked statically or dynamically.

https://code.google.com/p/phantomjs/issues/detail?id=430

(I have manage to make a static build on Linux to reproduce this issue - PR for that coming up - but I haven't been able to verify this fix on OS X. I am pretty sure that it works, but it would be worth verifying. Also, please cherry-pick to the 1.6 branch?)

Jon Leighton Fix remote inspector when building statically.
For some reason, it seems that checking CONFIG(static) inside
src/phantomjs.pro is not reliable. That caused the STATIC_BUILD define
not to be set, and hence Q_INIT_RESOURCE would never get called in
main.cpp.

Instead of using Q_INIT_RESOURCE, let's just compile the resources
directly into the phantomjs binary. This means we don't need to detect
whether Qt is linked statically or dynamically.

https://code.google.com/p/phantomjs/issues/detail?id=430
95186c6
Ariya Hidayat ariya merged commit 940e008 into from July 07, 2012
Ariya Hidayat ariya closed this July 07, 2012
Ivan De Marino detro referenced this pull request from a commit in detro/phantomjs January 04, 2014
Ivan De Marino Importing GhostDriver 1.1.0 in PhantomJS.
CHANGELOG for v1.1.0 (https://github.com/detro/ghostdriver/issues?labels=1.1.0&state=closed)

JavaScript Driver (Core)
* ENHANCEMENT: `/maximize` window will set the window size to 1336x768,
currently most common resolution online (see http://gs.statcounter.com/#resolution-ww-monthly-201307-201312)
* ENHANCEMENT #275: Implemented Browser and Network (HAR) Logging types
* FIXED #284: Attempt to wait for Page to Load if input causes form submit
* FIXED #291: Throw exception when attempting to set invalid timeout value
* FIXED #259: Fix issue regarding mouse clicks
* ENHANCEMENT #290: Enabled support for "Keep Alive" HTTP connections
* ENHANCEMENT #262: Allow access to PhantomJS API from WebDriver (Driver part)
* ENHANCEMENT #293: Import Selenium 2.39.0 WebDriver Atoms

Java Binding
* MINOR #251: Minor compilation issues for Binding
* ENHANCEMENT #262: Allow access to PhantomJS API from WebDriver (Java Binding part)

Tested using GhostDriver validation tests (https://github.com/detro/ghostdriver/tree/master/test).
8d598f9
Ivan De Marino detro referenced this pull request from a commit January 04, 2014
Ivan De Marino Importing GhostDriver 1.1.0 in PhantomJS.
CHANGELOG for v1.1.0 (https://github.com/detro/ghostdriver/issues?labels=1.1.0&state=closed)

JavaScript Driver (Core)
* ENHANCEMENT: `/maximize` window will set the window size to 1336x768,
currently most common resolution online (see http://gs.statcounter.com/#resolution-ww-monthly-201307-201312)
* ENHANCEMENT #275: Implemented Browser and Network (HAR) Logging types
* FIXED #284: Attempt to wait for Page to Load if input causes form submit
* FIXED #291: Throw exception when attempting to set invalid timeout value
* FIXED #259: Fix issue regarding mouse clicks
* ENHANCEMENT #290: Enabled support for "Keep Alive" HTTP connections
* ENHANCEMENT #262: Allow access to PhantomJS API from WebDriver (Driver part)
* ENHANCEMENT #293: Import Selenium 2.39.0 WebDriver Atoms

Java Binding
* MINOR #251: Minor compilation issues for Binding
* ENHANCEMENT #262: Allow access to PhantomJS API from WebDriver (Java Binding part)

Tested using GhostDriver validation tests (https://github.com/detro/ghostdriver/tree/master/test).

#11877
a9a219e
Ivan De Marino detro referenced this pull request from a commit January 04, 2014
Ivan De Marino Importing GhostDriver 1.1.0 in PhantomJS.
CHANGELOG for v1.1.0 (https://github.com/detro/ghostdriver/issues?labels=1.1.0&state=closed)

JavaScript Driver (Core)
* ENHANCEMENT: `/maximize` window will set the window size to 1336x768,
currently most common resolution online (see http://gs.statcounter.com/#resolution-ww-monthly-201307-201312)
* ENHANCEMENT #275: Implemented Browser and Network (HAR) Logging types
* FIXED #284: Attempt to wait for Page to Load if input causes form submit
* FIXED #291: Throw exception when attempting to set invalid timeout value
* FIXED #259: Fix issue regarding mouse clicks
* ENHANCEMENT #290: Enabled support for "Keep Alive" HTTP connections
* ENHANCEMENT #262: Allow access to PhantomJS API from WebDriver (Driver part)
* ENHANCEMENT #293: Import Selenium 2.39.0 WebDriver Atoms

Java Binding
* MINOR #251: Minor compilation issues for Binding
* ENHANCEMENT #262: Allow access to PhantomJS API from WebDriver (Java Binding part)

Tested using GhostDriver validation tests (https://github.com/detro/ghostdriver/tree/master/test).

#11877
0947eb6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jul 07, 2012
Jon Leighton Fix remote inspector when building statically.
For some reason, it seems that checking CONFIG(static) inside
src/phantomjs.pro is not reliable. That caused the STATIC_BUILD define
not to be set, and hence Q_INIT_RESOURCE would never get called in
main.cpp.

Instead of using Q_INIT_RESOURCE, let's just compile the resources
directly into the phantomjs binary. This means we don't need to detect
whether Qt is linked statically or dynamically.

https://code.google.com/p/phantomjs/issues/detail?id=430
95186c6
This page is out of date. Refresh to see the latest.
5  src/main.cpp
@@ -61,11 +61,6 @@ int main(int argc, char** argv, const char** envp)
61 61
     Utils::printDebugMessages = phantom.printDebugMessages();
62 62
     qInstallMsgHandler(Utils::messageHandler);
63 63
 
64  
-#ifdef STATIC_BUILD
65  
-    Q_INIT_RESOURCE(WebKit);
66  
-    Q_INIT_RESOURCE(InspectorBackendStub);
67  
-#endif
68  
-
69 64
     app.setWindowIcon(QIcon(":/phantomjs-icon.png"));
70 65
     app.setApplicationName("PhantomJS");
71 66
     app.setOrganizationName("Ofi Labs");
7  src/phantomjs.pro
@@ -5,7 +5,9 @@ CONFIG += console
5 5
 
6 6
 DESTDIR = ../bin
7 7
 
8  
-RESOURCES = phantomjs.qrc
  8
+RESOURCES = phantomjs.qrc \
  9
+    qt/src/3rdparty/webkit/Source/WebCore/inspector/front-end/WebKit.qrc \
  10
+    qt/src/3rdparty/webkit/Source/WebCore/generated/InspectorBackendStub.qrc
9 11
 
10 12
 HEADERS += csconverter.h \
11 13
     phantom.h \
@@ -103,6 +105,3 @@ mac {
103 105
 # Uncomment to build a Mac OS X Universal Binary (i.e. x86 + ppc)
104 106
 #    CONFIG += x86 ppc
105 107
 }
106  
-CONFIG(static) {
107  
-    DEFINES += STATIC_BUILD
108  
-}
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.